//<![CDATA[
/*********************************
 								 
 >> Javascript Version: 0.1		 
 >> Created on: July 02, 2014	 
 >> Designer: OM Templates        
								 
*********************************/

function removeHtmlTag(strx,chop){
if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
}
chop = (chop < strx.length-1) ? chop : strx.length-2;
while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
strx = strx.substring(0,chop-1);
return strx+'...';
}
function createSummaryAndThumb(pID, pURL, pTITLE){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = posts_no_thumb_sum;
if(img.length>=1) {
imgtag = '<div class="articlewrapper"><article class="post type-post status-publish format-gallery has-post-thumbnail hentry category-blog category-gallery tag-gallery content-loop"><div class="stickybadge"></div><div class="imgcontainer"><img width="770" height="370" src="'+img[0].src+'" class="scale-with-grid wp-post-image"/></div><div class="loopcontainer"><h2 class="posttitle"><a href="'+ pURL +'" title="'+ pTITLE+'" data-rel="bookmark">'+ pTITLE+'</a></h2><div class="entry-utility"></div><div class="entry-icon"><div class="fa fa-camera"></div></div>';
summ = posts_thumb_sum;
}

var summary = imgtag + '<div class="entry-content"><p>' + removeHtmlTag(div.innerHTML,summ) + '</p>  <div class="clearfix"></div></div> <br/><a href="'+ pURL +'" class="more-link btn">Continue Reading</a>     <div class="clearfix"></div><div class="sharebutton-container"><h6 class="sharebutton-title"><span class="sbt">Share On</span></h6><div class="ssba"><div style="text-align:center"><a class="ssba_google_share" href="https://plus.google.com/share?url='+ pURL +'" target="_blank"><img src="http://1.bp.blogspot.com/-PK5mAZO_Gbk/U7Tc092NyRI/AAAAAAAABNM/zhieI2agcmU/s1600/google.png" title="Google+" class="ssba" alt="Share on Google+" /></a><a class="ssba_pinterest_share" href="javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;//assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());"><img src="http://2.bp.blogspot.com/-qUVo90_K2JQ/U7Tc1wtv28I/AAAAAAAABNU/E1GsHZ9e-qY/s1600/pinterest.png" title="Pinterest" class="ssba" alt="Pin on Pinterest" /></a><a class="ssba_twitter_share" href="http://twitter.com/share?url='+ pURL +'&amp;text='+ pTITLE+'" target="_blank"><img src="http://1.bp.blogspot.com/-tDntJPM7XLA/U7Tc3A1TpgI/AAAAAAAABNo/wwd0yJT1krM/s1600/twitter.png" title="Twitter" class="ssba" alt="Tweet about this on Twitter" /></a><a class="ssba_diggit_share ssba_share_link" href="http://www.digg.com/submit?url='+ pURL +'" target="_blank"><img src="http://2.bp.blogspot.com/-4SEXEQH8K-o/U7Tc0h6TZCI/AAAAAAAABNE/LsWhyTwsQxM/s1600/diggit.png" title="Digg" class="ssba" alt="Digg this" /></a><a class="ssba_tumblr_share" href="http://www.tumblr.com/share/link?url='+ pURL +'&amp;name='+ pTITLE+'" target="_blank"><img src="http://3.bp.blogspot.com/-E36xP-t5dVU/U7Tc2aNODxI/AAAAAAAABNY/aE1rInGLKPw/s1600/tumblr.png" title="tumblr" class="ssba" alt="Share on Tumblr" /></a><a class="ssba_linkedin_share ssba_share_link"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url='+ pURL +'" target="_blank"><img src="http://2.bp.blogspot.com/-GXJ1DBCi5cs/U7Tc1ms_YNI/AAAAAAAABNs/LFWNbsvbiSk/s1600/linkedin.png" title="Linkedin" class="ssba" alt="Share on LinkedIn" /></a><a class="ssba_facebook_share" href="http://www.facebook.com/sharer.php?u='+ pURL +'" target="_blank"><img src="http://4.bp.blogspot.com/-t6GCNovcyw8/U7Tc0q3uKVI/AAAAAAAABNA/vRDpnrXkP6g/s1600/facebook.png" title="Facebook" class="ssba" alt="Share on Facebook" /></a></div></div></div></div><div class="clearfix"></div> <div class="clearfix"></div></article><div class="clearfix"/><div class="linemark"><span class="linepointer"/><span class="linearrow"/></div></div>';
div.innerHTML = summary;
}

imgr = new Array();
imgr[0] = "http://2.bp.blogspot.com/-ex3V86fj4dQ/UrCQQa4cLsI/AAAAAAAAFdA/j2FCTmGOrog/s1600/no-thumbnail.png";
showRandomImg = true;
aBold = true;
summaryPost = 400;
summaryTitle = 20;
numposts1 = 12;
numposts2 = 4;

function removeHtmlTag(strx, chop) {
    var s = strx.split("<");
    for (var i = 0; i < s.length; i++) {
        if (s[i].indexOf(">") != -1) {
            s[i] = s[i].substring(s[i].indexOf(">") + 1, s[i].length)
        }
    }
    s = s.join("");
    s = s.substring(0, chop - 1);
    return s
}

var _0x7f6c=["\x49\x20\x31\x4C\x28\x71\x29\x7B\x6A\x3D\x28\x31\x78\x29\x3F\x31\x61\x2E\x31\x4B\x28\x28\x47\x2E\x68\x2B\x31\x29\x2A\x31\x61\x2E\x31\x74\x28\x29\x29\x3A\x30\x3B\x6F\x3D\x31\x7A\x20\x31\x42\x28\x29\x3B\x67\x28\x31\x36\x3C\x3D\x71\x2E\x44\x2E\x66\x2E\x68\x29\x7B\x4A\x3D\x31\x36\x7D\x4D\x7B\x4A\x3D\x71\x2E\x44\x2E\x66\x2E\x68\x7D\x42\x28\x65\x20\x69\x3D\x30\x3B\x69\x3C\x4A\x3B\x69\x2B\x2B\x29\x7B\x65\x20\x66\x3D\x71\x2E\x44\x2E\x66\x5B\x69\x5D\x3B\x65\x20\x48\x3D\x66\x2E\x46\x2E\x24\x74\x3B\x65\x20\x41\x3B\x65\x20\x70\x3B\x67\x28\x69\x3D\x3D\x71\x2E\x44\x2E\x66\x2E\x68\x29\x75\x3B\x42\x28\x65\x20\x6B\x3D\x30\x3B\x6B\x3C\x66\x2E\x6C\x2E\x68\x3B\x6B\x2B\x2B\x29\x7B\x67\x28\x66\x2E\x6C\x5B\x6B\x5D\x2E\x76\x3D\x3D\x27\x31\x48\x27\x29\x7B\x70\x3D\x66\x2E\x6C\x5B\x6B\x5D\x2E\x6E\x3B\x75\x7D\x7D\x42\x28\x65\x20\x6B\x3D\x30\x3B\x6B\x3C\x66\x2E\x6C\x2E\x68\x3B\x6B\x2B\x2B\x29\x7B\x67\x28\x66\x2E\x6C\x5B\x6B\x5D\x2E\x76\x3D\x3D\x27\x31\x70\x27\x26\x26\x66\x2E\x6C\x5B\x6B\x5D\x2E\x31\x72\x3D\x3D\x27\x31\x73\x2F\x31\x33\x27\x29\x7B\x41\x3D\x66\x2E\x6C\x5B\x6B\x5D\x2E\x46\x2E\x77\x28\x22\x20\x22\x29\x5B\x30\x5D\x3B\x75\x7D\x7D\x67\x28\x22\x57\x22\x56\x20\x66\x29\x7B\x65\x20\x45\x3D\x66\x2E\x57\x2E\x24\x74\x7D\x4D\x20\x67\x28\x22\x54\x22\x56\x20\x66\x29\x7B\x65\x20\x45\x3D\x66\x2E\x54\x2E\x24\x74\x7D\x4D\x20\x65\x20\x45\x3D\x22\x22\x3B\x43\x3D\x66\x2E\x31\x63\x2E\x24\x74\x3B\x67\x28\x6A\x3E\x47\x2E\x68\x2D\x31\x29\x6A\x3D\x30\x3B\x6F\x5B\x69\x5D\x3D\x47\x5B\x6A\x5D\x3B\x73\x3D\x45\x3B\x61\x3D\x73\x2E\x4C\x28\x22\x3C\x6F\x22\x29\x3B\x62\x3D\x73\x2E\x4C\x28\x22\x53\x3D\x5C\x22\x22\x2C\x61\x29\x3B\x63\x3D\x73\x2E\x4C\x28\x22\x5C\x22\x22\x2C\x62\x2B\x35\x29\x3B\x64\x3D\x73\x2E\x31\x45\x28\x62\x2B\x35\x2C\x63\x2D\x62\x2D\x35\x29\x3B\x67\x28\x28\x61\x21\x3D\x2D\x31\x29\x26\x26\x28\x62\x21\x3D\x2D\x31\x29\x26\x26\x28\x63\x21\x3D\x2D\x31\x29\x26\x26\x28\x64\x21\x3D\x22\x22\x29\x29\x6F\x5B\x69\x5D\x3D\x64\x3B\x65\x20\x50\x3D\x5B\x31\x2C\x32\x2C\x33\x2C\x34\x2C\x35\x2C\x36\x2C\x37\x2C\x38\x2C\x39\x2C\x31\x30\x2C\x31\x31\x2C\x31\x32\x5D\x3B\x65\x20\x52\x3D\x5B\x22\x31\x64\x22\x2C\x22\x31\x65\x22\x2C\x22\x31\x66\x22\x2C\x22\x31\x67\x22\x2C\x22\x31\x68\x22\x2C\x22\x31\x69\x22\x2C\x22\x31\x6A\x22\x2C\x22\x31\x6B\x22\x2C\x22\x31\x6C\x22\x2C\x22\x31\x6D\x22\x2C\x22\x31\x6E\x22\x2C\x22\x31\x6F\x22\x5D\x3B\x65\x20\x5A\x3D\x43\x2E\x77\x28\x22\x2D\x22\x29\x5B\x32\x5D\x2E\x31\x71\x28\x30\x2C\x32\x29\x3B\x65\x20\x6D\x3D\x43\x2E\x77\x28\x22\x2D\x22\x29\x5B\x31\x5D\x3B\x65\x20\x79\x3D\x43\x2E\x77\x28\x22\x2D\x22\x29\x5B\x30\x5D\x3B\x42\x28\x65\x20\x72\x3D\x30\x3B\x72\x3C\x50\x2E\x68\x3B\x72\x2B\x2B\x29\x7B\x67\x28\x31\x75\x28\x6D\x29\x3D\x3D\x50\x5B\x72\x5D\x29\x7B\x6D\x3D\x52\x5B\x72\x5D\x3B\x75\x7D\x7D\x65\x20\x31\x76\x3D\x5A\x2B\x27\x20\x27\x2B\x6D\x2B\x27\x20\x27\x2B\x79\x3B\x41\x3D\x27\x3C\x61\x20\x6E\x3D\x22\x27\x2B\x70\x2B\x27\x22\x3E\x27\x2B\x41\x2B\x27\x20\x31\x77\x3C\x2F\x61\x3E\x27\x3B\x65\x20\x55\x3D\x27\x3C\x7A\x20\x78\x3D\x22\x31\x41\x22\x3E\x3C\x58\x20\x78\x3D\x22\x48\x22\x3E\x3C\x61\x20\x6E\x3D\x22\x27\x2B\x70\x2B\x27\x22\x3E\x27\x2B\x48\x2B\x27\x3C\x2F\x61\x3E\x3C\x2F\x58\x3E\x3C\x61\x20\x6E\x3D\x22\x27\x2B\x70\x2B\x27\x22\x3E\x3C\x6F\x20\x78\x3D\x22\x31\x43\x22\x20\x53\x3D\x22\x27\x2B\x6F\x5B\x69\x5D\x2B\x27\x22\x2F\x3E\x3C\x2F\x61\x3E\x3C\x7A\x20\x78\x3D\x22\x31\x44\x22\x3E\x3C\x2F\x7A\x3E\x3C\x2F\x7A\x3E\x27\x3B\x59\x2E\x31\x46\x28\x55\x29\x3B\x6A\x2B\x2B\x7D\x7D\x24\x28\x59\x29\x2E\x31\x47\x28\x49\x28\x29\x7B\x24\x28\x27\x23\x31\x62\x27\x29\x2E\x31\x33\x28\x22\x31\x49\x20\x31\x4A\x20\x3C\x61\x20\x6E\x3D\x27\x4B\x3A\x2F\x2F\x31\x34\x2E\x31\x35\x2E\x4F\x2F\x27\x20\x76\x3D\x27\x31\x37\x27\x20\x31\x38\x3D\x27\x31\x39\x27\x20\x46\x3D\x27\x4E\x20\x51\x27\x3E\x31\x4D\x20\x51\x3C\x2F\x61\x3E\x20\x31\x4E\x20\x3C\x61\x20\x6E\x3D\x27\x4B\x3A\x2F\x2F\x31\x4F\x2E\x4F\x2F\x27\x20\x76\x3D\x27\x31\x37\x27\x20\x31\x38\x3D\x27\x31\x39\x27\x20\x46\x3D\x27\x31\x50\x20\x4E\x20\x51\x27\x3E\x31\x51\x20\x4E\x20\x31\x52\x3C\x2F\x61\x3E\x22\x29\x3B\x31\x53\x28\x49\x28\x29\x7B\x67\x28\x21\x24\x28\x27\x23\x31\x62\x3A\x31\x54\x27\x29\x2E\x68\x29\x31\x55\x2E\x31\x56\x2E\x6E\x3D\x27\x4B\x3A\x2F\x2F\x31\x34\x2E\x31\x35\x2E\x4F\x2F\x27\x7D\x2C\x31\x79\x29\x7D\x29\x3B","\x7C","\x73\x70\x6C\x69\x74","\x7C\x7C\x7C\x7C\x7C\x7C\x7C\x7C\x7C\x7C\x7C\x7C\x7C\x7C\x76\x61\x72\x7C\x65\x6E\x74\x72\x79\x7C\x69\x66\x7C\x6C\x65\x6E\x67\x74\x68\x7C\x7C\x7C\x7C\x6C\x69\x6E\x6B\x7C\x7C\x68\x72\x65\x66\x7C\x69\x6D\x67\x7C\x70\x6F\x73\x74\x75\x72\x6C\x7C\x6A\x73\x6F\x6E\x7C\x75\x32\x7C\x7C\x7C\x62\x72\x65\x61\x6B\x7C\x72\x65\x6C\x7C\x73\x70\x6C\x69\x74\x7C\x63\x6C\x61\x73\x73\x7C\x7C\x64\x69\x76\x7C\x70\x63\x6D\x7C\x66\x6F\x72\x7C\x70\x6F\x73\x74\x64\x61\x74\x65\x7C\x66\x65\x65\x64\x7C\x70\x6F\x73\x74\x63\x6F\x6E\x74\x65\x6E\x74\x7C\x74\x69\x74\x6C\x65\x7C\x69\x6D\x67\x72\x7C\x70\x6F\x73\x74\x74\x69\x74\x6C\x65\x7C\x66\x75\x6E\x63\x74\x69\x6F\x6E\x7C\x6D\x61\x78\x70\x6F\x73\x74\x7C\x68\x74\x74\x70\x7C\x69\x6E\x64\x65\x78\x4F\x66\x7C\x65\x6C\x73\x65\x7C\x42\x6C\x6F\x67\x67\x65\x72\x7C\x63\x6F\x6D\x7C\x6D\x6F\x6E\x74\x68\x7C\x54\x65\x6D\x70\x6C\x61\x74\x65\x73\x7C\x6D\x6F\x6E\x74\x68\x32\x7C\x73\x72\x63\x7C\x73\x75\x6D\x6D\x61\x72\x79\x7C\x74\x72\x74\x64\x7C\x69\x6E\x7C\x63\x6F\x6E\x74\x65\x6E\x74\x7C\x68\x32\x7C\x64\x6F\x63\x75\x6D\x65\x6E\x74\x7C\x64\x61\x79\x7C\x7C\x7C\x7C\x68\x74\x6D\x6C\x7C\x77\x77\x77\x7C\x73\x6F\x72\x61\x74\x65\x6D\x70\x6C\x61\x74\x65\x73\x7C\x6E\x75\x6D\x70\x6F\x73\x74\x73\x32\x7C\x64\x6F\x66\x6F\x6C\x6C\x6F\x77\x7C\x74\x61\x72\x67\x65\x74\x7C\x5F\x62\x6C\x61\x6E\x6B\x7C\x4D\x61\x74\x68\x7C\x6D\x79\x63\x6F\x6E\x74\x65\x6E\x74\x7C\x70\x75\x62\x6C\x69\x73\x68\x65\x64\x7C\x4A\x61\x6E\x7C\x46\x65\x62\x7C\x4D\x61\x72\x7C\x41\x70\x72\x7C\x4D\x61\x79\x7C\x4A\x75\x6E\x7C\x4A\x75\x6C\x7C\x41\x75\x67\x7C\x53\x65\x70\x7C\x4F\x63\x74\x7C\x4E\x6F\x76\x7C\x44\x65\x63\x7C\x72\x65\x70\x6C\x69\x65\x73\x7C\x73\x75\x62\x73\x74\x72\x69\x6E\x67\x7C\x74\x79\x70\x65\x7C\x74\x65\x78\x74\x7C\x72\x61\x6E\x64\x6F\x6D\x7C\x70\x61\x72\x73\x65\x49\x6E\x74\x7C\x64\x61\x79\x73\x74\x72\x7C\x63\x6F\x6D\x6D\x65\x6E\x74\x73\x7C\x73\x68\x6F\x77\x52\x61\x6E\x64\x6F\x6D\x49\x6D\x67\x7C\x33\x30\x30\x30\x7C\x6E\x65\x77\x7C\x63\x6F\x6C\x5F\x6D\x61\x73\x6B\x6F\x6C\x69\x73\x7C\x41\x72\x72\x61\x79\x7C\x72\x65\x6C\x61\x74\x65\x64\x5F\x69\x6D\x67\x7C\x63\x6C\x65\x61\x72\x7C\x73\x75\x62\x73\x74\x72\x7C\x77\x72\x69\x74\x65\x7C\x72\x65\x61\x64\x79\x7C\x61\x6C\x74\x65\x72\x6E\x61\x74\x65\x7C\x43\x72\x65\x61\x74\x65\x64\x7C\x42\x79\x7C\x66\x6C\x6F\x6F\x72\x7C\x73\x68\x6F\x77\x72\x65\x63\x65\x6E\x74\x70\x6F\x73\x74\x73\x31\x7C\x53\x6F\x72\x61\x7C\x61\x6E\x64\x7C\x6D\x79\x62\x6C\x6F\x67\x67\x65\x72\x74\x68\x65\x6D\x65\x73\x7C\x46\x72\x65\x65\x7C\x4D\x79\x7C\x54\x68\x65\x6D\x65\x73\x7C\x73\x65\x74\x49\x6E\x74\x65\x72\x76\x61\x6C\x7C\x76\x69\x73\x69\x62\x6C\x65\x7C\x77\x69\x6E\x64\x6F\x77\x7C\x6C\x6F\x63\x61\x74\x69\x6F\x6E","","\x66\x72\x6F\x6D\x43\x68\x61\x72\x43\x6F\x64\x65","\x72\x65\x70\x6C\x61\x63\x65","\x5C\x77\x2B","\x5C\x62","\x67"];eval(function (_0x98c6x1,_0x98c6x2,_0x98c6x3,_0x98c6x4,_0x98c6x5,_0x98c6x6){_0x98c6x5=function (_0x98c6x3){return (_0x98c6x3<_0x98c6x2?_0x7f6c[4]:_0x98c6x5(parseInt(_0x98c6x3/_0x98c6x2)))+((_0x98c6x3=_0x98c6x3%_0x98c6x2)>35?String[_0x7f6c[5]](_0x98c6x3+29):_0x98c6x3.toString(36));} ;if(!_0x7f6c[4][_0x7f6c[6]](/^/,String)){while(_0x98c6x3--){_0x98c6x6[_0x98c6x5(_0x98c6x3)]=_0x98c6x4[_0x98c6x3]||_0x98c6x5(_0x98c6x3);} ;_0x98c6x4=[function (_0x98c6x5){return _0x98c6x6[_0x98c6x5];} ];_0x98c6x5=function (){return _0x7f6c[7];} ;_0x98c6x3=1;} ;while(_0x98c6x3--){if(_0x98c6x4[_0x98c6x3]){_0x98c6x1=_0x98c6x1[_0x7f6c[6]]( new RegExp(_0x7f6c[8]+_0x98c6x5(_0x98c6x3)+_0x7f6c[8],_0x7f6c[9]),_0x98c6x4[_0x98c6x3]);} ;} ;return _0x98c6x1;} (_0x7f6c[0],62,120,_0x7f6c[3][_0x7f6c[2]](_0x7f6c[1]),0,{}));


var relatedTitles = new Array();
var relatedTitlesNum = 0;
var relatedUrls = new Array();
var thumburl = new Array();

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('u N(x){q(6 i=0;i<x.K.g.3;i++){6 g=x.K.g[i];4[9]=g.J.$t;O{8[9]=g.V.W}X(M){s=g.P.$t;a=s.B("<G");b=s.B("E=\\"",a);c=s.B("\\"",b+5);d=s.T(b+5,c-b-5);f((a!=-1)&&(b!=-1)&&(c!=-1)&&(d!="")){8[9]=d}A 8[9]=\'Y://2.Z.10.11/-12/17/18/19/1c/1d-1e.1f\'}f(4[9].3>H)4[9]=4[9].1x(0,H)+"...";q(6 k=0;k<g.w.3;k++){f(g.w[k].Q==\'R\'){7[9]=g.w[k].D;9++}}}}u U(){6 n=y z(0);6 p=y z(0);6 o=y z(0);q(6 i=0;i<7.3;i++){f(!C(n,7[i])){n.3+=1;n[n.3-1]=7[i];p.3+=1;o.3+=1;p[p.3-1]=4[i];o[o.3-1]=8[i]}}4=p;7=n;8=o}u C(a,e){q(6 j=0;j<a.3;j++)f(a[j]==e)F 13;F 14}u 15(){q(6 i=0;i<7.3;i++){f((7[i]==16)||(!(4[i]))){7.m(i,1);4.m(i,1);8.m(i,1);i--}}6 r=I.1a((4.3-1)*I.1b());6 i=0;f(4.3>0)h.l(\'\');h.l(\'<v L="1g: 1h;"/>\');1i(i<4.3&&i<1j&&i<1k){h.l(\'<a L="1l-1m:1n;1o:0 1p 1q 0;1r:1s;\');f(i!=0)h.l(\'"\');A h.l(\'"\');h.l(\' D="\'+7[r]+\'"><G 1t="1u" E="\'+8[r]+\'"/><1v/><v 1w="S-J">\'+4[r]+\'</v></a>\');f(r<4.3-1){r++}A{r=0}i++}h.l(\'</v>\');7.m(0,7.3);8.m(0,8.3);4.m(0,4.3)}',62,96,'|||length|relatedTitles||var|relatedUrls|thumburl|relatedTitlesNum||||||if|entry|document||||write|splice|tmp|tmp3|tmp2|for||||function|div|link|json|new|Array|else|indexOf|contains_thumbs|href|src|return|img|35|Math|title|feed|style|error|related_results_labels_thumbs|try|content|rel|alternate|related|substr|removeRelatedDuplicates_thumbs|gform_foot|url|catch|http|bp|blogspot|com|ex3V86fj4dQ|true|false|printRelatedLabels_thumbs|currentposturl|UrCQQa4cLsI|AAAAAAAAFdA|j2FCTmGOrog|floor|random|s1600|no|thumbnail|png|clear|both|while|20|maxresults|text|decoration|none|margin|4px|10px|float|left|class|related_img|br|id|substring'.split('|'),0,{}))

/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
 * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexbox_legacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
 */
;
window.Modernizr = function (a, b, c) {
        function D(a) {
            j.cssText = a
        }

        function E(a, b) {
            return D(n.join(a + ";") + (b || ""))
        }

        function F(a, b) {
            return typeof a === b
        }

        function G(a, b) {
            return !!~("" + a).indexOf(b)
        }

        function H(a, b) {
            for (var d in a)
                if (j[a[d]] !== c) return b == "pfx" ? a[d] : !0;
            return !1
        }

        function I(a, b, d) {
            for (var e in a) {
                var f = b[a[e]];
                if (f !== c) return d === !1 ? a[e] : F(f, "function") ? f.bind(d || b) : f
            }
            return !1
        }

        function J(a, b, c) {
            var d = a.charAt(0).toUpperCase() + a.substr(1),
                e = (a + " " + p.join(d + " ") + d).split(" ");
            return F(b, "string") || F(b, "undefined") ? H(e, b) : (e = (a + " " + q.join(d + " ") + d).split(" "), I(e, b, c))
        }

        function L() {
            e.input = function (c) {
                for (var d = 0, e = c.length; d < e; d++) u[c[d]] = c[d] in k;
                return u.list && (u.list = !!b.createElement("datalist") && !!a.HTMLDataListElement), u
            }("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")), e.inputtypes = function (a) {
                for (var d = 0, e, f, h, i = a.length; d < i; d++) k.setAttribute("type", f = a[d]), e = k.type !== "text", e && (k.value = l, k.style.cssText = "position:absolute;visibility:hidden;", /^range$/.test(f) && k.style.WebkitAppearance !== c ? (g.appendChild(k), h = b.defaultView, e = h.getComputedStyle && h.getComputedStyle(k, null).WebkitAppearance !== "textfield" && k.offsetHeight !== 0, g.removeChild(k)) : /^(search|tel)$/.test(f) || (/^(url|email)$/.test(f) ? e = k.checkValidity && k.checkValidity() === !1 : /^color$/.test(f) ? (g.appendChild(k), g.offsetWidth, e = k.value != l, g.removeChild(k)) : e = k.value != l)), t[a[d]] = !!e;
                return t
            }("search tel url email datetime date month week time datetime-local number range color".split(" "))
        }
        var d = "2.5.3",
            e = {},
            f = !0,
            g = b.documentElement,
            h = "modernizr",
            i = b.createElement(h),
            j = i.style,
            k = b.createElement("input"),
            l = ":)",
            m = {}.toString,
            n = " -webkit- -moz- -o- -ms- ".split(" "),
            o = "Webkit Moz O ms",
            p = o.split(" "),
            q = o.toLowerCase().split(" "),
            r = {
                svg: "http://www.w3.org/2000/svg"
            },
            s = {},
            t = {},
            u = {},
            v = [],
            w = v.slice,
            x, y = function (a, c, d, e) {
                var f, i, j, k = b.createElement("div"),
                    l = b.body,
                    m = l ? l : b.createElement("body");
                if (parseInt(d, 10))
                    while (d--) j = b.createElement("div"), j.id = e ? e[d] : h + (d + 1), k.appendChild(j);
                return f = ["&#173;", "<style>", a, "</style>"].join(""), k.id = h, (l ? k : m).innerHTML += f, m.appendChild(k), l || (m.style.background = "", g.appendChild(m)), i = c(k, a), l ? k.parentNode.removeChild(k) : m.parentNode.removeChild(m), !!i
            },
            z = function (b) {
                var c = a.matchMedia || a.msMatchMedia;
                if (c) return c(b).matches;
                var d;
                return y("@media " + b + " { #" + h + " { position: absolute; } }", function (b) {
                    d = (a.getComputedStyle ? getComputedStyle(b, null) : b.currentStyle)["position"] == "absolute"
                }), d
            },
            A = function () {
                function d(d, e) {
                    e = e || b.createElement(a[d] || "div"), d = "on" + d;
                    var f = d in e;
                    return f || (e.setAttribute || (e = b.createElement("div")), e.setAttribute && e.removeAttribute && (e.setAttribute(d, ""), f = F(e[d], "function"), F(e[d], "undefined") || (e[d] = c), e.removeAttribute(d))), e = null, f
                }
                var a = {
                    select: "input",
                    change: "input",
                    submit: "form",
                    reset: "form",
                    error: "img",
                    load: "img",
                    abort: "img"
                };
                return d
            }(),
            B = {}.hasOwnProperty,
            C;
        !F(B, "undefined") && !F(B.call, "undefined") ? C = function (a, b) {
            return B.call(a, b)
        } : C = function (a, b) {
            return b in a && F(a.constructor.prototype[b], "undefined")
        }, Function.prototype.bind || (Function.prototype.bind = function (b) {
            var c = this;
            if (typeof c != "function") throw new TypeError;
            var d = w.call(arguments, 1),
                e = function () {
                    if (this instanceof e) {
                        var a = function () {};
                        a.prototype = c.prototype;
                        var f = new a,
                            g = c.apply(f, d.concat(w.call(arguments)));
                        return Object(g) === g ? g : f
                    }
                    return c.apply(b, d.concat(w.call(arguments)))
                };
            return e
        });
        var K = function (c, d) {
            var f = c.join(""),
                g = d.length;
            y(f, function (c, d) {
                var f = b.styleSheets[b.styleSheets.length - 1],
                    h = f ? f.cssRules && f.cssRules[0] ? f.cssRules[0].cssText : f.cssText || "" : "",
                    i = c.childNodes,
                    j = {};
                while (g--) j[i[g].id] = i[g];
                e.touch = "ontouchstart" in a || a.DocumentTouch && b instanceof DocumentTouch || (j.touch && j.touch.offsetTop) === 9, e.csstransforms3d = (j.csstransforms3d && j.csstransforms3d.offsetLeft) === 9 && j.csstransforms3d.offsetHeight === 3, e.generatedcontent = (j.generatedcontent && j.generatedcontent.offsetHeight) >= 1, e.fontface = /src/i.test(h) && h.indexOf(d.split(" ")[0]) === 0
            }, g, d)
        }(['@font-face {font-family:"font";src:url("https://")}', ["@media (", n.join("touch-enabled),("), h, ")", "{#touch{top:9px;position:absolute}}"].join(""), ["@media (", n.join("transform-3d),("), h, ")", "{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join(""), ['#generatedcontent:after{content:"', l, '";visibility:hidden}'].join("")], ["fontface", "touch", "csstransforms3d", "generatedcontent"]);
        s.flexbox = function () {
            return J("flexOrder")
        }, s["flexbox-legacy"] = function () {
            return J("boxDirection")
        }, s.canvas = function () {
            var a = b.createElement("canvas");
            return !!a.getContext && !!a.getContext("2d")
        }, s.canvastext = function () {
            return !!e.canvas && !!F(b.createElement("canvas").getContext("2d").fillText, "function")
        }, s.webgl = function () {
            try {
                var d = b.createElement("canvas"),
                    e;
                e = !(!a.WebGLRenderingContext || !d.getContext("experimental-webgl") && !d.getContext("webgl")), d = c
            } catch (f) {
                e = !1
            }
            return e
        }, s.touch = function () {
            return e.touch
        }, s.geolocation = function () {
            return !!navigator.geolocation
        }, s.postmessage = function () {
            return !!a.postMessage
        }, s.websqldatabase = function () {
            return !!a.openDatabase
        }, s.indexedDB = function () {
            return !!J("indexedDB", a)
        }, s.hashchange = function () {
            return A("hashchange", a) && (b.documentMode === c || b.documentMode > 7)
        }, s.history = function () {
            return !!a.history && !!history.pushState
        }, s.draganddrop = function () {
            var a = b.createElement("div");
            return "draggable" in a || "ondragstart" in a && "ondrop" in a
        }, s.websockets = function () {
            for (var b = -1, c = p.length; ++b < c;)
                if (a[p[b] + "WebSocket"]) return !0;
            return "WebSocket" in a
        }, s.rgba = function () {
            return D("background-color:rgba(150,255,150,.5)"), G(j.backgroundColor, "rgba")
        }, s.hsla = function () {
            return D("background-color:hsla(120,40%,100%,.5)"), G(j.backgroundColor, "rgba") || G(j.backgroundColor, "hsla")
        }, s.multiplebgs = function () {
            return D("background:url(https://),url(https://),red url(https://)"), /(url\s*\(.*?){3}/.test(j.background)
        }, s.backgroundsize = function () {
            return J("backgroundSize")
        }, s.borderimage = function () {
            return J("borderImage")
        }, s.borderradius = function () {
            return J("borderRadius")
        }, s.boxshadow = function () {
            return J("boxShadow")
        }, s.textshadow = function () {
            return b.createElement("div").style.textShadow === ""
        }, s.opacity = function () {
            return E("opacity:.55"), /^0.55$/.test(j.opacity)
        }, s.cssanimations = function () {
            return J("animationName")
        }, s.csscolumns = function () {
            return J("columnCount")
        }, s.cssgradients = function () {
            var a = "background-image:",
                b = "gradient(linear,left top,right bottom,from(#9f9),to(white));",
                c = "linear-gradient(left top,#9f9, white);";
            return D((a + "-webkit- ".split(" ").join(b + a) + n.join(c + a)).slice(0, -a.length)), G(j.backgroundImage, "gradient")
        }, s.cssreflections = function () {
            return J("boxReflect")
        }, s.csstransforms = function () {
            return !!J("transform")
        }, s.csstransforms3d = function () {
            var a = !!J("perspective");
            return a && "webkitPerspective" in g.style && (a = e.csstransforms3d), a
        }, s.csstransitions = function () {
            return J("transition")
        }, s.fontface = function () {
            return e.fontface
        }, s.generatedcontent = function () {
            return e.generatedcontent
        }, s.video = function () {
            var a = b.createElement("video"),
                c = !1;
            try {
                if (c = !!a.canPlayType) c = new Boolean(c), c.ogg = a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ""), c.h264 = a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ""), c.webm = a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "")
            } catch (d) {}
            return c
        }, s.audio = function () {
            var a = b.createElement("audio"),
                c = !1;
            try {
                if (c = !!a.canPlayType) c = new Boolean(c), c.ogg = a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), c.mp3 = a.canPlayType("audio/mpeg;").replace(/^no$/, ""), c.wav = a.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""), c.m4a = (a.canPlayType("audio/x-m4a;") || a.canPlayType("audio/aac;")).replace(/^no$/, "")
            } catch (d) {}
            return c
        }, s.localstorage = function () {
            try {
                return localStorage.setItem(h, h), localStorage.removeItem(h), !0
            } catch (a) {
                return !1
            }
        }, s.sessionstorage = function () {
            try {
                return sessionStorage.setItem(h, h), sessionStorage.removeItem(h), !0
            } catch (a) {
                return !1
            }
        }, s.webworkers = function () {
            return !!a.Worker
        }, s.applicationcache = function () {
            return !!a.applicationCache
        }, s.svg = function () {
            return !!b.createElementNS && !!b.createElementNS(r.svg, "svg").createSVGRect
        }, s.inlinesvg = function () {
            var a = b.createElement("div");
            return a.innerHTML = "<svg/>", (a.firstChild && a.firstChild.namespaceURI) == r.svg
        }, s.smil = function () {
            return !!b.createElementNS && /SVGAnimate/.test(m.call(b.createElementNS(r.svg, "animate")))
        }, s.svgclippaths = function () {
            return !!b.createElementNS && /SVGClipPath/.test(m.call(b.createElementNS(r.svg, "clipPath")))
        };
        for (var M in s) C(s, M) && (x = M.toLowerCase(), e[x] = s[M](), v.push((e[x] ? "" : "no-") + x));
        return e.input || L(), D(""), i = k = null,
            function (a, b) {
                function g(a, b) {
                    var c = a.createElement("p"),
                        d = a.getElementsByTagName("head")[0] || a.documentElement;
                    return c.innerHTML = "x<style>" + b + "</style>", d.insertBefore(c.lastChild, d.firstChild)
                }

                function h() {
                    var a = k.elements;
                    return typeof a == "string" ? a.split(" ") : a
                }

                function i(a) {
                    var b = {},
                        c = a.createElement,
                        e = a.createDocumentFragment,
                        f = e();
                    a.createElement = function (a) {
                        var e = (b[a] || (b[a] = c(a))).cloneNode();
                        return k.shivMethods && e.canHaveChildren && !d.test(a) ? f.appendChild(e) : e
                    }, a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + h().join().replace(/\w+/g, function (a) {
                        return b[a] = c(a), f.createElement(a), 'c("' + a + '")'
                    }) + ");return n}")(k, f)
                }

                function j(a) {
                    var b;
                    return a.documentShived ? a : (k.shivCSS && !e && (b = !!g(a, "article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")), f || (b = !i(a)), b && (a.documentShived = b), a)
                }
                var c = a.html5 || {},
                    d = /^<|^(?:button|form|map|select|textarea)$/i,
                    e, f;
                (function () {
                    var a = b.createElement("a");
                    a.innerHTML = "<xyz></xyz>", e = "hidden" in a, f = a.childNodes.length == 1 || function () {
                        try {
                            b.createElement("a")
                        } catch (a) {
                            return !0
                        }
                        var c = b.createDocumentFragment();
                        return typeof c.cloneNode == "undefined" || typeof c.createDocumentFragment == "undefined" || typeof c.createElement == "undefined"
                    }()
                })();
                var k = {
                    elements: c.elements || "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",
                    shivCSS: c.shivCSS !== !1,
                    shivMethods: c.shivMethods !== !1,
                    type: "default",
                    shivDocument: j
                };
                a.html5 = k, j(b)
            }(this, b), e._version = d, e._prefixes = n, e._domPrefixes = q, e._cssomPrefixes = p, e.mq = z, e.hasEvent = A, e.testProp = function (a) {
                return H([a])
            }, e.testAllProps = J, e.testStyles = y, g.className = g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + v.join(" ") : ""), e
    }(this, this.document),
    function (a, b, c) {
        function d(a) {
            return o.call(a) == "[object Function]"
        }

        function e(a) {
            return typeof a == "string"
        }

        function f() {}

        function g(a) {
            return !a || a == "loaded" || a == "complete" || a == "uninitialized"
        }

        function h() {
            var a = p.shift();
            q = 1, a ? a.t ? m(function () {
                (a.t == "c" ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1)
            }, 0) : (a(), h()) : q = 0
        }

        function i(a, c, d, e, f, i, j) {
            function k(b) {
                if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) {
                    a != "img" && m(function () {
                        t.removeChild(l)
                    }, 50);
                    for (var d in y[c]) y[c].hasOwnProperty(d) && y[c][d].onload()
                }
            }
            var j = j || B.errorTimeout,
                l = {},
                o = 0,
                r = 0,
                u = {
                    t: d,
                    s: c,
                    e: f,
                    a: i,
                    x: j
                };
            y[c] === 1 && (r = 1, y[c] = [], l = b.createElement(a)), a == "object" ? l.data = c : (l.src = c, l.type = a), l.width = l.height = "0", l.onerror = l.onload = l.onreadystatechange = function () {
                k.call(this, r)
            }, p.splice(e, 0, u), a != "img" && (r || y[c] === 2 ? (t.insertBefore(l, s ? null : n), m(k, j)) : y[c].push(l))
        }

        function j(a, b, c, d, f) {
            return q = 0, b = b || "j", e(a) ? i(b == "c" ? v : u, a, b, this.i++, c, d, f) : (p.splice(this.i++, 0, a), p.length == 1 && h()), this
        }

        function k() {
            var a = B;
            return a.loader = {
                load: j,
                i: 0
            }, a
        }
        var l = b.documentElement,
            m = a.setTimeout,
            n = b.getElementsByTagName("script")[0],
            o = {}.toString,
            p = [],
            q = 0,
            r = "MozAppearance" in l.style,
            s = r && !!b.createRange().compareNode,
            t = s ? l : n.parentNode,
            l = a.opera && o.call(a.opera) == "[object Opera]",
            l = !!b.attachEvent && !l,
            u = r ? "object" : l ? "script" : "img",
            v = l ? "script" : u,
            w = Array.isArray || function (a) {
                return o.call(a) == "[object Array]"
            },
            x = [],
            y = {},
            z = {
                timeout: function (a, b) {
                    return b.length && (a.timeout = b[0]), a
                }
            },
            A, B;
        B = function (a) {
            function b(a) {
                var a = a.split("!"),
                    b = x.length,
                    c = a.pop(),
                    d = a.length,
                    c = {
                        url: c,
                        origUrl: c,
                        prefixes: a
                    },
                    e, f, g;
                for (f = 0; f < d; f++) g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g));
                for (f = 0; f < b; f++) c = x[f](c);
                return c
            }

            function g(a, e, f, g, i) {
                var j = b(a),
                    l = j.autoCallback;
                j.url.split(".").pop().split("?").shift(), j.bypass || (e && (e = d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]] || h), j.instead ? j.instead(a, e, f, g, i) : (y[j.url] ? j.noexec = !0 : y[j.url] = 1, f.load(j.url, j.forceCSS || !j.forceJS && "css" == j.url.split(".").pop().split("?").shift() ? "c" : c, j.noexec, j.attrs, j.timeout), (d(e) || d(l)) && f.load(function () {
                    k(), e && e(j.origUrl, i, g), l && l(j.origUrl, i, g), y[j.url] = 2
                })))
            }

            function i(a, b) {
                function c(a, c) {
                    if (a) {
                        if (e(a)) c || (j = function () {
                            var a = [].slice.call(arguments);
                            k.apply(this, a), l()
                        }), g(a, j, b, 0, h);
                        else if (Object(a) === a)
                            for (n in m = function () {
                                var b = 0,
                                    c;
                                for (c in a) a.hasOwnProperty(c) && b++;
                                return b
                            }(), a) a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function () {
                                var a = [].slice.call(arguments);
                                k.apply(this, a), l()
                            } : j[n] = function (a) {
                                return function () {
                                    var b = [].slice.call(arguments);
                                    a && a.apply(this, b), l()
                                }
                            }(k[n])), g(a[n], j, b, n, h))
                    } else !c && l()
                }
                var h = !!a.test,
                    i = a.load || a.both,
                    j = a.callback || f,
                    k = j,
                    l = a.complete || f,
                    m, n;
                c(h ? a.yep : a.nope, !!i), i && c(i)
            }
            var j, l, m = this.yepnope.loader;
            if (e(a)) g(a, 0, m, 0);
            else if (w(a))
                for (j = 0; j < a.length; j++) l = a[j], e(l) ? g(l, 0, m, 0) : w(l) ? B(l) : Object(l) === l && i(l, m);
            else Object(a) === a && i(a, m)
        }, B.addPrefix = function (a, b) {
            z[a] = b
        }, B.addFilter = function (a) {
            x.push(a)
        }, B.errorTimeout = 1e4, b.readyState == null && b.addEventListener && (b.readyState = "loading", b.addEventListener("DOMContentLoaded", A = function () {
            b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete"
        }, 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function (a, c, d, e, i, j) {
            var k = b.createElement("script"),
                l, o, e = e || B.errorTimeout;
            k.src = a;
            for (o in d) k.setAttribute(o, d[o]);
            c = j ? h : c || f, k.onreadystatechange = k.onload = function () {
                !l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null)
            }, m(function () {
                l || (l = 1, c(1))
            }, e), i ? k.onload() : n.parentNode.insertBefore(k, n)
        }, a.yepnope.injectCss = function (a, c, d, e, g, i) {
            var e = b.createElement("link"),
                j, c = i ? h : c || f;
            e.href = a, e.rel = "stylesheet", e.type = "text/css";
            for (j in d) e.setAttribute(j, d[j]);
            g || (n.parentNode.insertBefore(e, n), m(c, 0))
        }
    }(this, document), Modernizr.load = function () {
        yepnope.apply(window, [].slice.call(arguments, 0))
    };

/*
 * jQuery.appear
 * https://github.com/bas2k/jquery.appear/
 * http://code.google.com/p/jquery-appear/
 *
 * Copyright (c) 2009 Michael Hixson
 * Copyright (c) 2012 Alexander Brovikov
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
 */
(function($) {
    $.fn.appear = function(fn, options) {

        var settings = $.extend({

            //arbitrary data to pass to fn
            data: undefined,

            //call fn only on the first appear?
            one: true,

            // X & Y accuracy
            accX: 0,
            accY: 0

        }, options);

        return this.each(function() {

            var t = $(this);

            //whether the element is currently visible
            t.appeared = false;

            if (!fn) {

                //trigger the custom event
                t.trigger('appear', settings.data);
                return;
            }

            var w = $(window);

            //fires the appear event when appropriate
            var check = function() {

                //is the element hidden?
                if (!t.is(':visible')) {

                    //it became hidden
                    t.appeared = false;
                    return;
                }

                //is the element inside the visible window?
                var a = w.scrollLeft();
                var b = w.scrollTop();
                var o = t.offset();
                var x = o.left;
                var y = o.top;

                var ax = settings.accX;
                var ay = settings.accY;
                var th = t.height();
                var wh = w.height();
                var tw = t.width();
                var ww = w.width();

                if (y + th + ay >= b &&
                    y <= b + wh + ay &&
                    x + tw + ax >= a &&
                    x <= a + ww + ax) {

                    //trigger the custom event
                    if (!t.appeared) t.trigger('appear', settings.data);

                } else {

                    //it scrolled out of view
                    t.appeared = false;
                }
            };

            //create a modified fn with some additional logic
            var modifiedFn = function() {

                //mark the element as visible
                t.appeared = true;

                //is this supposed to happen only once?
                if (settings.one) {

                    //remove the check
                    w.unbind('scroll', check);
                    var i = $.inArray(check, $.fn.appear.checks);
                    if (i >= 0) $.fn.appear.checks.splice(i, 1);
                }

                //trigger the original fn
                fn.apply(this, arguments);
            };

            //bind the modified fn to the element
            if (settings.one) t.one('appear', settings.data, modifiedFn);
            else t.bind('appear', settings.data, modifiedFn);

            //check whenever the window scrolls
            w.scroll(check);

            //check whenever the dom changes
            $.fn.appear.checks.push(check);

            //check now
            (check)();
        });
    };

    //keep a queue of appearance checks
    $.extend($.fn.appear, {

        checks: [],
        timeout: null,

        //process the queue
        checkAll: function() {
            var length = $.fn.appear.checks.length;
            if (length > 0) while (length--) ($.fn.appear.checks[length])();
        },

        //check the queue asynchronously
        run: function() {
            if ($.fn.appear.timeout) clearTimeout($.fn.appear.timeout);
            $.fn.appear.timeout = setTimeout($.fn.appear.checkAll, 20);
        }
    });

    //run checks when these methods are called
    $.each(['append', 'prepend', 'after', 'before', 'attr',
        'removeAttr', 'addClass', 'removeClass', 'toggleClass',
        'remove', 'css', 'show', 'hide'], function(i, n) {
        var old = $.fn[n];
        if (old) {
            $.fn[n] = function() {
                var r = old.apply(this, arguments);
                $.fn.appear.run();
                return r;
            }
        }
    });

})(jQuery);



















(function($) {
    $.fn.countTo = function(options) {
        // merge the default plugin settings with the custom options
        options = $.extend({}, $.fn.countTo.defaults, options || {});

        // how many times to update the value, and how much to increment the value on each update
        var loops = Math.ceil(options.speed / options.refreshInterval),
            increment = (options.to - options.from) / loops;

        return $(this).each(function() {
            var _this = this,
                loopCount = 0,
                value = options.from,
                interval = setInterval(updateTimer, options.refreshInterval);

            function updateTimer() {
                value += increment;
                loopCount++;
                $(_this).html(value.toFixed(options.decimals));

                if (typeof(options.onUpdate) == 'function') {
                    options.onUpdate.call(_this, value);
                }

                if (loopCount >= loops) {
                    clearInterval(interval);
                    value = options.to;

                    if (typeof(options.onComplete) == 'function') {
                        options.onComplete.call(_this, value);
                    }
                }
            }
        });
    };

    $.fn.countTo.defaults = {
        from: 0,  // the number the element should start at
        to: 100,  // the number the element should end at
        speed: 1000,  // how long it should take to count between the target numbers
        refreshInterval: 100,  // how often the element should be updated
        decimals: 0,  // the number of decimal places to show
        onUpdate: null,  // callback method for every time the element is updated,
        onComplete: null,  // callback method for when the element finishes updating
    };
})(jQuery);	

(function($) {

	if (typeof _wpcf7 == 'undefined' || _wpcf7 === null)
		_wpcf7 = {};

	_wpcf7 = $.extend({ cached: 0 }, _wpcf7);

	$(function() {
		_wpcf7.supportHtml5 = $.wpcf7SupportHtml5();
		$('div.wpcf7 > form').wpcf7InitForm();
	});

	$.fn.wpcf7InitForm = function() {
		this.ajaxForm({
			beforeSubmit: function(arr, $form, options) {
				$form.wpcf7ClearResponseOutput();
				$form.find('[aria-invalid]').attr('aria-invalid', 'false');
				$form.find('img.ajax-loader').css({ visibility: 'visible' });
				return true;
			},
			beforeSerialize: function($form, options) {
				$form.find('[placeholder].placeheld').each(function(i, n) {
					$(n).val('');
				});
				return true;
			},
			data: { '_wpcf7_is_ajax_call': 1 },
			dataType: 'json',
			success: $.wpcf7AjaxSuccess,
			error: function(xhr, status, error, $form) {
				var e = $('<div class="ajax-error"></div>').text(error.message);
				$form.after(e);
			}
		});

		if (_wpcf7.cached)
			this.wpcf7OnloadRefill();

		this.wpcf7ToggleSubmit();

		this.find('.wpcf7-submit').wpcf7AjaxLoader();

		this.find('.wpcf7-acceptance').click(function() {
			$(this).closest('form').wpcf7ToggleSubmit();
		});

		this.find('.wpcf7-exclusive-checkbox').wpcf7ExclusiveCheckbox();

		this.find('.wpcf7-list-item.has-free-text').wpcf7ToggleCheckboxFreetext();

		this.find('[placeholder]').wpcf7Placeholder();

		if (_wpcf7.jqueryUi && ! _wpcf7.supportHtml5.date) {
			this.find('input.wpcf7-date[type="date"]').each(function() {
				$(this).datepicker({
					dateFormat: 'yy-mm-dd',
					minDate: new Date($(this).attr('min')),
					maxDate: new Date($(this).attr('max'))
				});
			});
		}

		if (_wpcf7.jqueryUi && ! _wpcf7.supportHtml5.number) {
			this.find('input.wpcf7-number[type="number"]').each(function() {
				$(this).spinner({
					min: $(this).attr('min'),
					max: $(this).attr('max'),
					step: $(this).attr('step')
				});
			});
		}
	};

	$.wpcf7AjaxSuccess = function(data, status, xhr, $form) {
		if (! $.isPlainObject(data) || $.isEmptyObject(data))
			return;

		var $responseOutput = $form.find('div.wpcf7-response-output');

		$form.wpcf7ClearResponseOutput();

		$form.find('.wpcf7-form-control').removeClass('wpcf7-not-valid');
		$form.removeClass('invalid spam sent failed');

		if (data.captcha)
			$form.wpcf7RefillCaptcha(data.captcha);

		if (data.quiz)
			$form.wpcf7RefillQuiz(data.quiz);

		if (data.invalids) {
			$.each(data.invalids, function(i, n) {
				$form.find(n.into).wpcf7NotValidTip(n.message);
				$form.find(n.into).find('.wpcf7-form-control').addClass('wpcf7-not-valid');
				$form.find(n.into).find('[aria-invalid]').attr('aria-invalid', 'true');
			});

			$responseOutput.addClass('wpcf7-validation-errors');
			$form.addClass('invalid');

			$(data.into).trigger('invalid.wpcf7');

		} else if (1 == data.spam) {
			$responseOutput.addClass('wpcf7-spam-blocked');
			$form.addClass('spam');

			$(data.into).trigger('spam.wpcf7');

		} else if (1 == data.mailSent) {
			$responseOutput.addClass('wpcf7-mail-sent-ok');
			$form.addClass('sent');

			if (data.onSentOk)
				$.each(data.onSentOk, function(i, n) { eval(n) });

			$(data.into).trigger('mailsent.wpcf7');

		} else {
			$responseOutput.addClass('wpcf7-mail-sent-ng');
			$form.addClass('failed');

			$(data.into).trigger('mailfailed.wpcf7');
		}

		if (data.onSubmit)
			$.each(data.onSubmit, function(i, n) { eval(n) });

		$(data.into).trigger('submit.wpcf7');

		if (1 == data.mailSent)
			$form.resetForm();

		$form.find('[placeholder].placeheld').each(function(i, n) {
			$(n).val($(n).attr('placeholder'));
		});

		$responseOutput.append(data.message).slideDown('fast');
		$responseOutput.attr('role', 'alert');

		$.wpcf7UpdateScreenReaderResponse($form, data);
	}

	$.fn.wpcf7ExclusiveCheckbox = function() {
		return this.find('input:checkbox').click(function() {
			$(this).closest('.wpcf7-checkbox').find('input:checkbox').not(this).removeAttr('checked');
		});
	};

	$.fn.wpcf7Placeholder = function() {
		if (_wpcf7.supportHtml5.placeholder)
			return this;

		return this.each(function() {
			$(this).val($(this).attr('placeholder'));
			$(this).addClass('placeheld');

			$(this).focus(function() {
				if ($(this).hasClass('placeheld'))
					$(this).val('').removeClass('placeheld');
			});

			$(this).blur(function() {
				if ('' == $(this).val()) {
					$(this).val($(this).attr('placeholder'));
					$(this).addClass('placeheld');
				}
			});
		});
	};

	$.fn.wpcf7AjaxLoader = function() {
		return this.each(function() {
			var loader = $('<img class="ajax-loader" />')
				.attr({ src: _wpcf7.loaderUrl, alt: _wpcf7.sending })
				.css('visibility', 'hidden');

			$(this).after(loader);
		});
	};

	$.fn.wpcf7ToggleSubmit = function() {
		return this.each(function() {
			var form = $(this);
			if (this.tagName.toLowerCase() != 'form')
				form = $(this).find('form').first();

			if (form.hasClass('wpcf7-acceptance-as-validation'))
				return;

			var submit = form.find('input:submit');
			if (! submit.length) return;

			var acceptances = form.find('input:checkbox.wpcf7-acceptance');
			if (! acceptances.length) return;

			submit.removeAttr('disabled');
			acceptances.each(function(i, n) {
				n = $(n);
				if (n.hasClass('wpcf7-invert') && n.is(':checked')
				|| ! n.hasClass('wpcf7-invert') && ! n.is(':checked'))
					submit.attr('disabled', 'disabled');
			});
		});
	};

	$.fn.wpcf7ToggleCheckboxFreetext = function() {
		return this.each(function() {
			var $wrap = $(this).closest('.wpcf7-form-control');

			if ($(this).find(':checkbox, :radio').is(':checked')) {
				$(this).find(':input.wpcf7-free-text').prop('disabled', false);
			} else {
				$(this).find(':input.wpcf7-free-text').prop('disabled', true);
			}

			$wrap.find(':checkbox, :radio').change(function() {
				var $cb = $('.has-free-text', $wrap).find(':checkbox, :radio');
				var $freetext = $(':input.wpcf7-free-text', $wrap);

				if ($cb.is(':checked')) {
					$freetext.prop('disabled', false).focus();
				} else {
					$freetext.prop('disabled', true);
				}
			});
		});
	};

	$.fn.wpcf7NotValidTip = function(message) {
		return this.each(function() {
			var $into = $(this);
			$into.hide().append('<span role="alert" class="wpcf7-not-valid-tip">' + message + '</span>').slideDown('fast');

			if ($into.is('.use-floating-validation-tip *')) {
				$('.wpcf7-not-valid-tip', $into).mouseover(function() {
					$(this).wpcf7FadeOut();
				});

				$(':input', $into).focus(function() {
					$('.wpcf7-not-valid-tip', $into).not(':hidden').wpcf7FadeOut();
				});
			}
		});
	};

	$.fn.wpcf7FadeOut = function() {
		return this.each(function() {
			$(this).animate({
				opacity: 0
			}, 'fast', function() {
				$(this).css({'z-index': -100});
			});
		});
	};

	$.fn.wpcf7OnloadRefill = function() {
		return this.each(function() {
			var url = $(this).attr('action');
			if (0 < url.indexOf('#'))
				url = url.substr(0, url.indexOf('#'));

			var id = $(this).find('input[name="_wpcf7"]').val();
			var unitTag = $(this).find('input[name="_wpcf7_unit_tag"]').val();

			$.getJSON(url,
				{ _wpcf7_is_ajax_call: 1, _wpcf7: id, _wpcf7_request_ver: $.now() },
				function(data) {
					if (data && data.captcha)
						$('#' + unitTag).wpcf7RefillCaptcha(data.captcha);

					if (data && data.quiz)
						$('#' + unitTag).wpcf7RefillQuiz(data.quiz);
				}
			);
		});
	};

	$.fn.wpcf7RefillCaptcha = function(captcha) {
		return this.each(function() {
			var form = $(this);

			$.each(captcha, function(i, n) {
				form.find(':input[name="' + i + '"]').clearFields();
				form.find('img.wpcf7-captcha-' + i).attr('src', n);
				var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n);
				form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]);
			});
		});
	};

	$.fn.wpcf7RefillQuiz = function(quiz) {
		return this.each(function() {
			var form = $(this);

			$.each(quiz, function(i, n) {
				form.find(':input[name="' + i + '"]').clearFields();
				form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]);
				form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]);
			});
		});
	};

	$.fn.wpcf7ClearResponseOutput = function() {
		return this.each(function() {
			$(this).find('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked').removeAttr('role');
			$(this).find('span.wpcf7-not-valid-tip').remove();
			$(this).find('img.ajax-loader').css({ visibility: 'hidden' });
		});
	};

	$.wpcf7UpdateScreenReaderResponse = function($form, data) {
		$('.wpcf7 .screen-reader-response').html('').attr('role', '');

		if (data.message) {
			var $response = $form.siblings('.screen-reader-response').first();
			$response.append(data.message);

			if (data.invalids) {
				var $invalids = $('<ul></ul>');

				$.each(data.invalids, function(i, n) {
					if (n.idref) {
						var $li = $('<li></li>').append($('<a></a>').attr('href', '#' + n.idref).append(n.message));
					} else {
						var $li = $('<li></li>').append(n.message);
					}

					$invalids.append($li);
				});

				$response.append($invalids);
			}

			$response.attr('role', 'alert').focus();
		}
	}

	$.wpcf7SupportHtml5 = function() {
		var features = {};
		var input = document.createElement('input');

		features.placeholder = 'placeholder' in input;

		var inputTypes = ['email', 'url', 'tel', 'number', 'range', 'date'];

		$.each(inputTypes, function(index, value) {
			input.setAttribute('type', value);
			features[value] = input.type !== 'text';
		});

		return features;
	};

})(jQuery);

/*!
 * Retina.js v1.3.0
 *
 * Copyright 2014 Imulus, LLC
 * Released under the MIT license
 *
 * Retina.js is an open source script that makes it easy to serve
 * high-resolution images to devices with retina displays.
 */

(function() {
    var root = (typeof exports === 'undefined' ? window : exports);
    var config = {
        // An option to choose a suffix for 2x images
        retinaImageSuffix : '@2x',

        // Ensure Content-Type is an image before trying to load @2x image
        // https://github.com/imulus/retinajs/pull/45)
        check_mime_type: true,

        // Resize high-resolution images to original image's pixel dimensions
        // https://github.com/imulus/retinajs/issues/8
        force_original_dimensions: true
    };

    function Retina() {}

    root.Retina = Retina;

    Retina.configure = function(options) {
        if (options === null) {
            options = {};
        }

        for (var prop in options) {
            if (options.hasOwnProperty(prop)) {
                config[prop] = options[prop];
            }
        }
    };

    Retina.init = function(context) {
        if (context === null) {
            context = root;
        }

        var existing_onload = context.onload || function(){};

        context.onload = function() {
            var images = document.getElementsByTagName('img'), retinaImages = [], i, image;
            for (i = 0; i < images.length; i += 1) {
                image = images[i];
                if (!!!image.getAttributeNode('data-no-retina')) {
                    retinaImages.push(new RetinaImage(image));
                }
            }
            existing_onload();
        };
    };

    Retina.isRetina = function(){
        var mediaQuery = '(-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx)';

        if (root.devicePixelRatio > 1) {
            return true;
        }

        if (root.matchMedia && root.matchMedia(mediaQuery).matches) {
            return true;
        }

        return false;
    };


    var regexMatch = /\.\w+$/;
    function suffixReplace (match) {
        return config.retinaImageSuffix + match;
    }

    function RetinaImagePath(path, at_2x_path) {
        this.path = path || '';
        if (typeof at_2x_path !== 'undefined' && at_2x_path !== null) {
            this.at_2x_path = at_2x_path;
            this.perform_check = false;
        } else {
            if (undefined !== document.createElement) {
                var locationObject = document.createElement('a');
                locationObject.href = this.path;
                locationObject.pathname = locationObject.pathname.replace(regexMatch, suffixReplace);
                this.at_2x_path = locationObject.href;
            } else {
                var parts = this.path.split('?');
                parts[0] = parts[0].replace(regexMatch, suffixReplace);
                this.at_2x_path = parts.join('?');
            }
            this.perform_check = true;
        }
    }

    root.RetinaImagePath = RetinaImagePath;

    RetinaImagePath.confirmed_paths = [];

    RetinaImagePath.prototype.is_external = function() {
        return !!(this.path.match(/^https?\:/i) && !this.path.match('//' + document.domain) );
    };

    RetinaImagePath.prototype.check_2x_variant = function(callback) {
        var http, that = this;
        if (this.is_external()) {
            return callback(false);
        } else if (!this.perform_check && typeof this.at_2x_path !== 'undefined' && this.at_2x_path !== null) {
            return callback(true);
        } else if (this.at_2x_path in RetinaImagePath.confirmed_paths) {
            return callback(true);
        } else {
            http = new XMLHttpRequest();
            http.open('HEAD', this.at_2x_path);
            http.onreadystatechange = function() {
                if (http.readyState !== 4) {
                    return callback(false);
                }

                if (http.status >= 200 && http.status <= 399) {
                    if (config.check_mime_type) {
                        var type = http.getResponseHeader('Content-Type');
                        if (type === null || !type.match(/^image/i)) {
                            return callback(false);
                        }
                    }

                    RetinaImagePath.confirmed_paths.push(that.at_2x_path);
                    return callback(true);
                } else {
                    return callback(false);
                }
            };
            http.send();
        }
    };


    function RetinaImage(el) {
        this.el = el;
        this.path = new RetinaImagePath(this.el.getAttribute('src'), this.el.getAttribute('data-at2x'));
        var that = this;
        this.path.check_2x_variant(function(hasVariant) {
            if (hasVariant) {
                that.swap();
            }
        });
    }

    root.RetinaImage = RetinaImage;

    RetinaImage.prototype.swap = function(path) {
        if (typeof path === 'undefined') {
            path = this.path.at_2x_path;
        }

        var that = this;
        function load() {
            if (! that.el.complete) {
                setTimeout(load, 5);
            } else {
                if (config.force_original_dimensions) {
                    that.el.setAttribute('width', that.el.offsetWidth);
                    that.el.setAttribute('height', that.el.offsetHeight);
                }

                that.el.setAttribute('src', path);
            }
        }
        load();
    };


    if (Retina.isRetina()) {
        Retina.init(root);
    }
})();

/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Ã‚Â© 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright Ã‚Â© 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */

/**
 * Isotope v1.5.21
 * An exquisite jQuery plugin for magical layouts
 * http://isotope.metafizzy.co
 *
 * Commercial use requires one-time license fee
 * http://metafizzy.co/#licenses
 *
 * Copyright 2012 David DeSandro / Metafizzy
 */
(function (a, b, c) {
    "use strict";
    var d = a.document,
        e = a.Modernizr,
        f = function (a) {
            return a.charAt(0).toUpperCase() + a.slice(1)
        },
        g = "Moz Webkit O Ms".split(" "),
        h = function (a) {
            var b = d.documentElement.style,
                c;
            if (typeof b[a] == "string") return a;
            a = f(a);
            for (var e = 0, h = g.length; e < h; e++) {
                c = g[e] + a;
                if (typeof b[c] == "string") return c
            }
        },
        i = h("transform"),
        j = h("transitionProperty"),
        k = {
            csstransforms: function () {
                return !!i
            },
            csstransforms3d: function () {
                var a = !!h("perspective");
                if (a) {
                    var c = " -o- -moz- -ms- -webkit- -khtml- ".split(" "),
                        d = "@media (" + c.join("transform-3d),(") + "modernizr)",
                        e = b("<style>" + d + "{#modernizr{height:3px}}" + "</style>").appendTo("head"),
                        f = b('<div id="modernizr" />').appendTo("html");
                    a = f.height() === 3, f.remove(), e.remove()
                }
                return a
            },
            csstransitions: function () {
                return !!j
            }
        },
        l;
    if (e)
        for (l in k) e.hasOwnProperty(l) || e.addTest(l, k[l]);
    else {
        e = a.Modernizr = {
            _version: "1.6ish: miniModernizr for Isotope"
        };
        var m = " ",
            n;
        for (l in k) n = k[l](), e[l] = n, m += " " + (n ? "" : "no-") + l;
        b("html").addClass(m)
    } if (e.csstransforms) {
        var o = e.csstransforms3d ? {
                translate: function (a) {
                    return "translate3d(" + a[0] + "px, " + a[1] + "px, 0) "
                },
                scale: function (a) {
                    return "scale3d(" + a + ", " + a + ", 1) "
                }
            } : {
                translate: function (a) {
                    return "translate(" + a[0] + "px, " + a[1] + "px) "
                },
                scale: function (a) {
                    return "scale(" + a + ") "
                }
            },
            p = function (a, c, d) {
                var e = b.data(a, "isoTransform") || {},
                    f = {},
                    g, h = {},
                    j;
                f[c] = d, b.extend(e, f);
                for (g in e) j = e[g], h[g] = o[g](j);
                var k = h.translate || "",
                    l = h.scale || "",
                    m = k + l;
                b.data(a, "isoTransform", e), a.style[i] = m
            };
        b.cssNumber.scale = !0, b.cssHooks.scale = {
            set: function (a, b) {
                p(a, "scale", b)
            },
            get: function (a, c) {
                var d = b.data(a, "isoTransform");
                return d && d.scale ? d.scale : 1
            }
        }, b.fx.step.scale = function (a) {
            b.cssHooks.scale.set(a.elem, a.now + a.unit)
        }, b.cssNumber.translate = !0, b.cssHooks.translate = {
            set: function (a, b) {
                p(a, "translate", b)
            },
            get: function (a, c) {
                var d = b.data(a, "isoTransform");
                return d && d.translate ? d.translate : [0, 0]
            }
        }
    }
    var q, r;
    e.csstransitions && (q = {
        WebkitTransitionProperty: "webkitTransitionEnd",
        MozTransitionProperty: "transitionend",
        OTransitionProperty: "oTransitionEnd otransitionend",
        transitionProperty: "transitionend"
    }[j], r = h("transitionDuration"));
    var s = b.event,
        t;
    s.special.smartresize = {
        setup: function () {
            b(this).bind("resize", s.special.smartresize.handler)
        },
        teardown: function () {
            b(this).unbind("resize", s.special.smartresize.handler)
        },
        handler: function (a, b) {
            var c = this,
                d = arguments;
            a.type = "smartresize", t && clearTimeout(t), t = setTimeout(function () {
                jQuery.event.handle.apply(c, d)
            }, b === "execAsap" ? 0 : 100)
        }
    }, b.fn.smartresize = function (a) {
        return a ? this.bind("smartresize", a) : this.trigger("smartresize", ["execAsap"])
    }, b.Isotope = function (a, c, d) {
        this.element = b(c), this._create(a), this._init(d)
    };
    var u = ["width", "height"],
        v = b(a);
    b.Isotope.settings = {
        resizable: !0,
        layoutMode: "masonry",
        containerClass: "isotope",
        itemClass: "isotope-item",
        hiddenClass: "isotope-hidden",
        hiddenStyle: {
            opacity: 0,
            scale: .001
        },
        visibleStyle: {
            opacity: 1,
            scale: 1
        },
        containerStyle: {
            position: "relative",
            overflow: "hidden"
        },
        animationEngine: "best-available",
        animationOptions: {
            queue: !1,
            duration: 800
        },
        sortBy: "original-order",
        sortAscending: !0,
        resizesContainer: !0,
        transformsEnabled: !0,
        itemPositionDataEnabled: !1
    }, b.Isotope.prototype = {
        _create: function (a) {
            this.options = b.extend({}, b.Isotope.settings, a), this.styleQueue = [], this.elemCount = 0;
            var c = this.element[0].style;
            this.originalStyle = {};
            var d = u.slice(0);
            for (var e in this.options.containerStyle) d.push(e);
            for (var f = 0, g = d.length; f < g; f++) e = d[f], this.originalStyle[e] = c[e] || "";
            this.element.css(this.options.containerStyle), this._updateAnimationEngine(), this._updateUsingTransforms();
            var h = {
                "original-order": function (a, b) {
                    return b.elemCount++, b.elemCount
                },
                random: function () {
                    return Math.random()
                }
            };
            this.options.getSortData = b.extend(this.options.getSortData, h), this.reloadItems(), this.offset = {
                left: parseInt(this.element.css("padding-left") || 0, 10),
                top: parseInt(this.element.css("padding-top") || 0, 10)
            };
            var i = this;
            setTimeout(function () {
                i.element.addClass(i.options.containerClass)
            }, 0), this.options.resizable && v.bind("smartresize.isotope", function () {
                i.resize()
            }), this.element.delegate("." + this.options.hiddenClass, "click", function () {
                return !1
            })
        },
        _getAtoms: function (a) {
            var b = this.options.itemSelector,
                c = b ? a.filter(b).add(a.find(b)) : a,
                d = {
                    position: "absolute"
                };
            return this.usingTransforms && (d.left = 0, d.top = 0), c.css(d).addClass(this.options.itemClass), this.updateSortData(c, !0), c
        },
        _init: function (a) {
            this.$filteredAtoms = this._filter(this.$allAtoms), this._sort(), this.reLayout(a)
        },
        option: function (a) {
            if (b.isPlainObject(a)) {
                this.options = b.extend(!0, this.options, a);
                var c;
                for (var d in a) c = "_update" + f(d), this[c] && this[c]()
            }
        },
        _updateAnimationEngine: function () {
            var a = this.options.animationEngine.toLowerCase().replace(/[ _\-]/g, ""),
                b;
            switch (a) {
            case "css":
            case "none":
                b = !1;
                break;
            case "jquery":
                b = !0;
                break;
            default:
                b = !e.csstransitions
            }
            this.isUsingJQueryAnimation = b, this._updateUsingTransforms()
        },
        _updateTransformsEnabled: function () {
            this._updateUsingTransforms()
        },
        _updateUsingTransforms: function () {
            var a = this.usingTransforms = this.options.transformsEnabled && e.csstransforms && e.csstransitions && !this.isUsingJQueryAnimation;
            a || (delete this.options.hiddenStyle.scale, delete this.options.visibleStyle.scale), this.getPositionStyles = a ? this._translate : this._positionAbs
        },
        _filter: function (a) {
            var b = this.options.filter === "" ? "*" : this.options.filter;
            if (!b) return a;
            var c = this.options.hiddenClass,
                d = "." + c,
                e = a.filter(d),
                f = e;
            if (b !== "*") {
                f = e.filter(b);
                var g = a.not(d).not(b).addClass(c);
                this.styleQueue.push({
                    $el: g,
                    style: this.options.hiddenStyle
                })
            }
            return this.styleQueue.push({
                $el: f,
                style: this.options.visibleStyle
            }), f.removeClass(c), a.filter(b)
        },
        updateSortData: function (a, c) {
            var d = this,
                e = this.options.getSortData,
                f, g;
            a.each(function () {
                f = b(this), g = {};
                for (var a in e)!c && a === "original-order" ? g[a] = b.data(this, "isotope-sort-data")[a] : g[a] = e[a](f, d);
                b.data(this, "isotope-sort-data", g)
            })
        },
        _sort: function () {
            var a = this.options.sortBy,
                b = this._getSorter,
                c = this.options.sortAscending ? 1 : -1,
                d = function (d, e) {
                    var f = b(d, a),
                        g = b(e, a);
                    return f === g && a !== "original-order" && (f = b(d, "original-order"), g = b(e, "original-order")), (f > g ? 1 : f < g ? -1 : 0) * c
                };
            this.$filteredAtoms.sort(d)
        },
        _getSorter: function (a, c) {
            return b.data(a, "isotope-sort-data")[c]
        },
        _translate: function (a, b) {
            return {
                translate: [a, b]
            }
        },
        _positionAbs: function (a, b) {
            return {
                left: a,
                top: b
            }
        },
        _pushPosition: function (a, b, c) {
            b = Math.round(b + this.offset.left), c = Math.round(c + this.offset.top);
            var d = this.getPositionStyles(b, c);
            this.styleQueue.push({
                $el: a,
                style: d
            }), this.options.itemPositionDataEnabled && a.data("isotope-item-position", {
                x: b,
                y: c
            })
        },
        layout: function (a, b) {
            var c = this.options.layoutMode;
            this["_" + c + "Layout"](a);
            if (this.options.resizesContainer) {
                var d = this["_" + c + "GetContainerSize"]();
                this.styleQueue.push({
                    $el: this.element,
                    style: d
                })
            }
            this._processStyleQueue(a, b), this.isLaidOut = !0
        },
        _processStyleQueue: function (a, c) {
            var d = this.isLaidOut ? this.isUsingJQueryAnimation ? "animate" : "css" : "css",
                f = this.options.animationOptions,
                g = this.options.onLayout,
                h, i, j, k;
            i = function (a, b) {
                b.$el[d](b.style, f)
            };
            if (this._isInserting && this.isUsingJQueryAnimation) i = function (a, b) {
                h = b.$el.hasClass("no-transition") ? "css" : d, b.$el[h](b.style, f)
            };
            else if (c || g || f.complete) {
                var l = !1,
                    m = [c, g, f.complete],
                    n = this;
                j = !0, k = function () {
                    if (l) return;
                    var b;
                    for (var c = 0, d = m.length; c < d; c++) b = m[c], typeof b == "function" && b.call(n.element, a, n);
                    l = !0
                };
                if (this.isUsingJQueryAnimation && d === "animate") f.complete = k, j = !1;
                else if (e.csstransitions) {
                    var o = 0,
                        p = this.styleQueue[0],
                        s = p && p.$el,
                        t;
                    while (!s || !s.length) {
                        t = this.styleQueue[o++];
                        if (!t) return;
                        s = t.$el
                    }
                    var u = parseFloat(getComputedStyle(s[0])[r]);
                    u > 0 && (i = function (a, b) {
                        b.$el[d](b.style, f).one(q, k)
                    }, j = !1)
                }
            }
            b.each(this.styleQueue, i), j && k(), this.styleQueue = []
        },
        resize: function () {
            this["_" + this.options.layoutMode + "ResizeChanged"]() && this.reLayout()
        },
        reLayout: function (a) {
            this["_" + this.options.layoutMode + "Reset"](), this.layout(this.$filteredAtoms, a)
        },
        addItems: function (a, b) {
            var c = this._getAtoms(a);
            this.$allAtoms = this.$allAtoms.add(c), b && b(c)
        },
        insert: function (a, b) {
            this.element.append(a);
            var c = this;
            this.addItems(a, function (a) {
                var d = c._filter(a);
                c._addHideAppended(d), c._sort(), c.reLayout(), c._revealAppended(d, b)
            })
        },
        appended: function (a, b) {
            var c = this;
            this.addItems(a, function (a) {
                c._addHideAppended(a), c.layout(a), c._revealAppended(a, b)
            })
        },
        _addHideAppended: function (a) {
            this.$filteredAtoms = this.$filteredAtoms.add(a), a.addClass("no-transition"), this._isInserting = !0, this.styleQueue.push({
                $el: a,
                style: this.options.hiddenStyle
            })
        },
        _revealAppended: function (a, b) {
            var c = this;
            setTimeout(function () {
                a.removeClass("no-transition"), c.styleQueue.push({
                    $el: a,
                    style: c.options.visibleStyle
                }), c._isInserting = !1, c._processStyleQueue(a, b)
            }, 10)
        },
        reloadItems: function () {
            this.$allAtoms = this._getAtoms(this.element.children())
        },
        remove: function (a, b) {
            this.$allAtoms = this.$allAtoms.not(a), this.$filteredAtoms = this.$filteredAtoms.not(a);
            var c = this,
                d = function () {
                    a.remove(), b && b.call(c.element)
                };
            a.filter(":not(." + this.options.hiddenClass + ")").length ? (this.styleQueue.push({
                $el: a,
                style: this.options.hiddenStyle
            }), this._sort(), this.reLayout(d)) : d()
        },
        shuffle: function (a) {
            this.updateSortData(this.$allAtoms), this.options.sortBy = "random", this._sort(), this.reLayout(a)
        },
        destroy: function () {
            var a = this.usingTransforms,
                b = this.options;
            this.$allAtoms.removeClass(b.hiddenClass + " " + b.itemClass).each(function () {
                var b = this.style;
                b.position = "", b.top = "", b.left = "", b.opacity = "", a && (b[i] = "")
            });
            var c = this.element[0].style;
            for (var d in this.originalStyle) c[d] = this.originalStyle[d];
            this.element.unbind(".isotope").undelegate("." + b.hiddenClass, "click").removeClass(b.containerClass).removeData("isotope"), v.unbind(".isotope")
        },
        _getSegments: function (a) {
            var b = this.options.layoutMode,
                c = a ? "rowHeight" : "columnWidth",
                d = a ? "height" : "width",
                e = a ? "rows" : "cols",
                g = this.element[d](),
                h, i = this.options[b] && this.options[b][c] || this.$filteredAtoms["outer" + f(d)](!0) || g;
            h = Math.floor(g / i), h = Math.max(h, 1), this[b][e] = h, this[b][c] = i
        },
        _checkIfSegmentsChanged: function (a) {
            var b = this.options.layoutMode,
                c = a ? "rows" : "cols",
                d = this[b][c];
            return this._getSegments(a), this[b][c] !== d
        },
        _masonryReset: function () {
            this.masonry = {}, this._getSegments();
            var a = this.masonry.cols;
            this.masonry.colYs = [];
            while (a--) this.masonry.colYs.push(0)
        },
        _masonryLayout: function (a) {
            var c = this,
                d = c.masonry;
            a.each(function () {
                var a = b(this),
                    e = Math.ceil(a.outerWidth(!0) / d.columnWidth);
                e = Math.min(e, d.cols);
                if (e === 1) c._masonryPlaceBrick(a, d.colYs);
                else {
                    var f = d.cols + 1 - e,
                        g = [],
                        h, i;
                    for (i = 0; i < f; i++) h = d.colYs.slice(i, i + e), g[i] = Math.max.apply(Math, h);
                    c._masonryPlaceBrick(a, g)
                }
            })
        },
        _masonryPlaceBrick: function (a, b) {
            var c = Math.min.apply(Math, b),
                d = 0;
            for (var e = 0, f = b.length; e < f; e++)
                if (b[e] === c) {
                    d = e;
                    break
                }
            var g = this.masonry.columnWidth * d,
                h = c;
            this._pushPosition(a, g, h);
            var i = c + a.outerHeight(!0),
                j = this.masonry.cols + 1 - f;
            for (e = 0; e < j; e++) this.masonry.colYs[d + e] = i
        },
        _masonryGetContainerSize: function () {
            var a = Math.max.apply(Math, this.masonry.colYs);
            return {
                height: a
            }
        },
        _masonryResizeChanged: function () {
            return this._checkIfSegmentsChanged()
        },
        _fitRowsReset: function () {
            this.fitRows = {
                x: 0,
                y: 0,
                height: 0
            }
        },
        _fitRowsLayout: function (a) {
            var c = this,
                d = this.element.width(),
                e = this.fitRows;
            a.each(function () {
                var a = b(this),
                    f = a.outerWidth(!0),
                    g = a.outerHeight(!0);
                e.x !== 0 && f + e.x > d && (e.x = 0, e.y = e.height), c._pushPosition(a, e.x, e.y), e.height = Math.max(e.y + g, e.height), e.x += f
            })
        },
        _fitRowsGetContainerSize: function () {
            return {
                height: this.fitRows.height
            }
        },
        _fitRowsResizeChanged: function () {
            return !0
        },
        _cellsByRowReset: function () {
            this.cellsByRow = {
                index: 0
            }, this._getSegments(), this._getSegments(!0)
        },
        _cellsByRowLayout: function (a) {
            var c = this,
                d = this.cellsByRow;
            a.each(function () {
                var a = b(this),
                    e = d.index % d.cols,
                    f = Math.floor(d.index / d.cols),
                    g = (e + .5) * d.columnWidth - a.outerWidth(!0) / 2,
                    h = (f + .5) * d.rowHeight - a.outerHeight(!0) / 2;
                c._pushPosition(a, g, h), d.index++
            })
        },
        _cellsByRowGetContainerSize: function () {
            return {
                height: Math.ceil(this.$filteredAtoms.length / this.cellsByRow.cols) * this.cellsByRow.rowHeight + this.offset.top
            }
        },
        _cellsByRowResizeChanged: function () {
            return this._checkIfSegmentsChanged()
        },
        _straightDownReset: function () {
            this.straightDown = {
                y: 0
            }
        },
        _straightDownLayout: function (a) {
            var c = this;
            a.each(function (a) {
                var d = b(this);
                c._pushPosition(d, 0, c.straightDown.y), c.straightDown.y += d.outerHeight(!0)
            })
        },
        _straightDownGetContainerSize: function () {
            return {
                height: this.straightDown.y
            }
        },
        _straightDownResizeChanged: function () {
            return !0
        },
        _masonryHorizontalReset: function () {
            this.masonryHorizontal = {}, this._getSegments(!0);
            var a = this.masonryHorizontal.rows;
            this.masonryHorizontal.rowXs = [];
            while (a--) this.masonryHorizontal.rowXs.push(0)
        },
        _masonryHorizontalLayout: function (a) {
            var c = this,
                d = c.masonryHorizontal;
            a.each(function () {
                var a = b(this),
                    e = Math.ceil(a.outerHeight(!0) / d.rowHeight);
                e = Math.min(e, d.rows);
                if (e === 1) c._masonryHorizontalPlaceBrick(a, d.rowXs);
                else {
                    var f = d.rows + 1 - e,
                        g = [],
                        h, i;
                    for (i = 0; i < f; i++) h = d.rowXs.slice(i, i + e), g[i] = Math.max.apply(Math, h);
                    c._masonryHorizontalPlaceBrick(a, g)
                }
            })
        },
        _masonryHorizontalPlaceBrick: function (a, b) {
            var c = Math.min.apply(Math, b),
                d = 0;
            for (var e = 0, f = b.length; e < f; e++)
                if (b[e] === c) {
                    d = e;
                    break
                }
            var g = c,
                h = this.masonryHorizontal.rowHeight * d;
            this._pushPosition(a, g, h);
            var i = c + a.outerWidth(!0),
                j = this.masonryHorizontal.rows + 1 - f;
            for (e = 0; e < j; e++) this.masonryHorizontal.rowXs[d + e] = i
        },
        _masonryHorizontalGetContainerSize: function () {
            var a = Math.max.apply(Math, this.masonryHorizontal.rowXs);
            return {
                width: a
            }
        },
        _masonryHorizontalResizeChanged: function () {
            return this._checkIfSegmentsChanged(!0)
        },
        _fitColumnsReset: function () {
            this.fitColumns = {
                x: 0,
                y: 0,
                width: 0
            }
        },
        _fitColumnsLayout: function (a) {
            var c = this,
                d = this.element.height(),
                e = this.fitColumns;
            a.each(function () {
                var a = b(this),
                    f = a.outerWidth(!0),
                    g = a.outerHeight(!0);
                e.y !== 0 && g + e.y > d && (e.x = e.width, e.y = 0), c._pushPosition(a, e.x, e.y), e.width = Math.max(e.x + f, e.width), e.y += g
            })
        },
        _fitColumnsGetContainerSize: function () {
            return {
                width: this.fitColumns.width
            }
        },
        _fitColumnsResizeChanged: function () {
            return !0
        },
        _cellsByColumnReset: function () {
            this.cellsByColumn = {
                index: 0
            }, this._getSegments(), this._getSegments(!0)
        },
        _cellsByColumnLayout: function (a) {
            var c = this,
                d = this.cellsByColumn;
            a.each(function () {
                var a = b(this),
                    e = Math.floor(d.index / d.rows),
                    f = d.index % d.rows,
                    g = (e + .5) * d.columnWidth - a.outerWidth(!0) / 2,
                    h = (f + .5) * d.rowHeight - a.outerHeight(!0) / 2;
                c._pushPosition(a, g, h), d.index++
            })
        },
        _cellsByColumnGetContainerSize: function () {
            return {
                width: Math.ceil(this.$filteredAtoms.length / this.cellsByColumn.rows) * this.cellsByColumn.columnWidth
            }
        },
        _cellsByColumnResizeChanged: function () {
            return this._checkIfSegmentsChanged(!0)
        },
        _straightAcrossReset: function () {
            this.straightAcross = {
                x: 0
            }
        },
        _straightAcrossLayout: function (a) {
            var c = this;
            a.each(function (a) {
                var d = b(this);
                c._pushPosition(d, c.straightAcross.x, 0), c.straightAcross.x += d.outerWidth(!0)
            })
        },
        _straightAcrossGetContainerSize: function () {
            return {
                width: this.straightAcross.x
            }
        },
        _straightAcrossResizeChanged: function () {
            return !0
        }
    }, b.fn.imagesLoaded = function (a) {
        function h() {
            a.call(c, d)
        }

        function i(a) {
            var c = a.target;
            c.src !== f && b.inArray(c, g) === -1 && (g.push(c), --e <= 0 && (setTimeout(h), d.unbind(".imagesLoaded", i)))
        }
        var c = this,
            d = c.find("img").add(c.filter("img")),
            e = d.length,
            f = "",
            g = [];
        return e || h(), d.bind("load.imagesLoaded error.imagesLoaded", i).each(function () {
            var a = this.src;
            this.src = f, this.src = a
        }), c
    };
    var w = function (b) {
        a.console && a.console.error(b)
    };
    b.fn.isotope = function (a, c) {
        if (typeof a == "string") {
            var d = Array.prototype.slice.call(arguments, 1);
            this.each(function () {
                var c = b.data(this, "isotope");
                if (!c) {
                    w("cannot call methods on isotope prior to initialization; attempted to call method '" + a + "'");
                    return
                }
                if (!b.isFunction(c[a]) || a.charAt(0) === "_") {
                    w("no such method '" + a + "' for isotope instance");
                    return
                }
                c[a].apply(c, d)
            })
        } else this.each(function () {
            var d = b.data(this, "isotope");
            d ? (d.option(a), d._init(c)) : b.data(this, "isotope", new b.Isotope(a, this, c))
        });
        return this
    }
})(window, jQuery);

/*! perfect-scrollbar - v0.4.9
 * http://noraesae.github.com/perfect-scrollbar/
 * Copyright (c) 2014 Hyeonje Jun; Licensed MIT */
(function (e) {
    "use strict";
    "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? e(require("jquery")) : e(jQuery)
})(function (e) {
    "use strict";
    var t = {
            wheelSpeed: 10,
            wheelPropagation: !1,
            minScrollbarLength: null,
            useBothWheelAxes: !1,
            useKeyboard: !0,
            suppressScrollX: !1,
            suppressScrollY: !1,
            scrollXMarginOffset: 0,
            scrollYMarginOffset: 0,
            includePadding: !1
        },
        n = function () {
            var e = 0;
            return function () {
                var t = e;
                return e += 1, ".perfect-scrollbar-" + t
            }
        }();
    e.fn.perfectScrollbar = function (o, r) {
        return this.each(function () {
            var l = e.extend(!0, {}, t),
                a = e(this);
            if ("object" == typeof o ? e.extend(!0, l, o) : r = o, "update" === r) return a.data("perfect-scrollbar-update") && a.data("perfect-scrollbar-update")(), a;
            if ("destroy" === r) return a.data("perfect-scrollbar-destroy") && a.data("perfect-scrollbar-destroy")(), a;
            if (a.data("perfect-scrollbar")) return a.data("perfect-scrollbar");
            a.addClass("ps-container");
            var s, i, c, u, d, p, f, h, v, g, b = e("<div class='ps-scrollbar-x-rail'></div>").appendTo(a),
                m = e("<div class='ps-scrollbar-y-rail'></div>").appendTo(a),
                w = e("<div class='ps-scrollbar-x'></div>").appendTo(b),
                T = e("<div class='ps-scrollbar-y'></div>").appendTo(m),
                y = parseInt(b.css("bottom"), 10),
                L = parseInt(m.css("right"), 10),
                S = n(),
                x = function (e, t) {
                    var n = e + t,
                        o = u - v;
                    g = 0 > n ? 0 : n > o ? o : n;
                    var r = parseInt(g * (p - u) / (u - v), 10);
                    a.scrollTop(r), b.css({
                        bottom: y - r
                    })
                },
                M = function (e, t) {
                    var n = e + t,
                        o = c - f;
                    h = 0 > n ? 0 : n > o ? o : n;
                    var r = parseInt(h * (d - c) / (c - f), 10);
                    a.scrollLeft(r), m.css({
                        right: L - r
                    })
                },
                P = function (e) {
                    return l.minScrollbarLength && (e = Math.max(e, l.minScrollbarLength)), e
                },
                X = function () {
                    b.css({
                        left: a.scrollLeft(),
                        bottom: y - a.scrollTop(),
                        width: c,
                        display: s ? "inherit" : "none"
                    }), m.css({
                        top: a.scrollTop(),
                        right: L - a.scrollLeft(),
                        height: u,
                        display: i ? "inherit" : "none"
                    }), w.css({
                        left: h,
                        width: f
                    }), T.css({
                        top: g,
                        height: v
                    })
                },
                D = function () {
                    c = l.includePadding ? a.innerWidth() : a.width(), u = l.includePadding ? a.innerHeight() : a.height(), d = a.prop("scrollWidth"), p = a.prop("scrollHeight"), !l.suppressScrollX && d > c + l.scrollXMarginOffset ? (s = !0, f = P(parseInt(c * c / d, 10)), h = parseInt(a.scrollLeft() * (c - f) / (d - c), 10)) : (s = !1, f = 0, h = 0, a.scrollLeft(0)), !l.suppressScrollY && p > u + l.scrollYMarginOffset ? (i = !0, v = P(parseInt(u * u / p, 10)), g = parseInt(a.scrollTop() * (u - v) / (p - u), 10)) : (i = !1, v = 0, g = 0, a.scrollTop(0)), g >= u - v && (g = u - v), h >= c - f && (h = c - f), X()
                },
                I = function () {
                    var t, n;
                    w.bind("mousedown" + S, function (e) {
                        n = e.pageX, t = w.position().left, b.addClass("in-scrolling"), e.stopPropagation(), e.preventDefault()
                    }), e(document).bind("mousemove" + S, function (e) {
                        b.hasClass("in-scrolling") && (M(t, e.pageX - n), e.stopPropagation(), e.preventDefault())
                    }), e(document).bind("mouseup" + S, function () {
                        b.hasClass("in-scrolling") && b.removeClass("in-scrolling")
                    }), t = n = null
                },
                Y = function () {
                    var t, n;
                    T.bind("mousedown" + S, function (e) {
                        n = e.pageY, t = T.position().top, m.addClass("in-scrolling"), e.stopPropagation(), e.preventDefault()
                    }), e(document).bind("mousemove" + S, function (e) {
                        m.hasClass("in-scrolling") && (x(t, e.pageY - n), e.stopPropagation(), e.preventDefault())
                    }), e(document).bind("mouseup" + S, function () {
                        m.hasClass("in-scrolling") && m.removeClass("in-scrolling")
                    }), t = n = null
                },
                k = function (e, t) {
                    var n = a.scrollTop();
                    if (0 === e) {
                        if (!i) return !1;
                        if (0 === n && t > 0 || n >= p - u && 0 > t) return !l.wheelPropagation
                    }
                    var o = a.scrollLeft();
                    if (0 === t) {
                        if (!s) return !1;
                        if (0 === o && 0 > e || o >= d - c && e > 0) return !l.wheelPropagation
                    }
                    return !0
                },
                C = function () {
                    l.wheelSpeed /= 10;
                    var e = !1;
                    a.bind("mousewheel" + S, function (t, n, o, r) {
                        var c = t.deltaX * t.deltaFactor || o,
                            u = t.deltaY * t.deltaFactor || r;
                        e = !1, l.useBothWheelAxes ? i && !s ? (u ? a.scrollTop(a.scrollTop() - u * l.wheelSpeed) : a.scrollTop(a.scrollTop() + c * l.wheelSpeed), e = !0) : s && !i && (c ? a.scrollLeft(a.scrollLeft() + c * l.wheelSpeed) : a.scrollLeft(a.scrollLeft() - u * l.wheelSpeed), e = !0) : (a.scrollTop(a.scrollTop() - u * l.wheelSpeed), a.scrollLeft(a.scrollLeft() + c * l.wheelSpeed)), D(), e = e || k(c, u), e && (t.stopPropagation(), t.preventDefault())
                    }), a.bind("MozMousePixelScroll" + S, function (t) {
                        e && t.preventDefault()
                    })
                },
                j = function () {
                    var t = !1;
                    a.bind("mouseenter" + S, function () {
                        t = !0
                    }), a.bind("mouseleave" + S, function () {
                        t = !1
                    });
                    var n = !1;
                    e(document).bind("keydown" + S, function (o) {
                        if (t && !e(document.activeElement).is(":input,[contenteditable]")) {
                            var r = 0,
                                l = 0;
                            switch (o.which) {
                            case 37:
                                r = -30;
                                break;
                            case 38:
                                l = 30;
                                break;
                            case 39:
                                r = 30;
                                break;
                            case 40:
                                l = -30;
                                break;
                            case 33:
                                l = 90;
                                break;
                            case 32:
                            case 34:
                                l = -90;
                                break;
                            case 35:
                                l = -u;
                                break;
                            case 36:
                                l = u;
                                break;
                            default:
                                return
                            }
                            a.scrollTop(a.scrollTop() - l), a.scrollLeft(a.scrollLeft() + r), n = k(r, l), n && o.preventDefault()
                        }
                    })
                },
                O = function () {
                    var e = function (e) {
                        e.stopPropagation()
                    };
                    T.bind("click" + S, e), m.bind("click" + S, function (e) {
                        var t = parseInt(v / 2, 10),
                            n = e.pageY - m.offset().top - t,
                            o = u - v,
                            r = n / o;
                        0 > r ? r = 0 : r > 1 && (r = 1), a.scrollTop((p - u) * r)
                    }), w.bind("click" + S, e), b.bind("click" + S, function (e) {
                        var t = parseInt(f / 2, 10),
                            n = e.pageX - b.offset().left - t,
                            o = c - f,
                            r = n / o;
                        0 > r ? r = 0 : r > 1 && (r = 1), a.scrollLeft((d - c) * r)
                    })
                },
                E = function () {
                    var t = function (e, t) {
                            a.scrollTop(a.scrollTop() - t), a.scrollLeft(a.scrollLeft() - e), D()
                        },
                        n = {},
                        o = 0,
                        r = {},
                        l = null,
                        s = !1;
                    e(window).bind("touchstart" + S, function () {
                        s = !0
                    }), e(window).bind("touchend" + S, function () {
                        s = !1
                    }), a.bind("touchstart" + S, function (e) {
                        var t = e.originalEvent.targetTouches[0];
                        n.pageX = t.pageX, n.pageY = t.pageY, o = (new Date).getTime(), null !== l && clearInterval(l), e.stopPropagation()
                    }), a.bind("touchmove" + S, function (e) {
                        if (!s && 1 === e.originalEvent.targetTouches.length) {
                            var l = e.originalEvent.targetTouches[0],
                                a = {};
                            a.pageX = l.pageX, a.pageY = l.pageY;
                            var i = a.pageX - n.pageX,
                                c = a.pageY - n.pageY;
                            t(i, c), n = a;
                            var u = (new Date).getTime(),
                                d = u - o;
                            d > 0 && (r.x = i / d, r.y = c / d, o = u), e.preventDefault()
                        }
                    }), a.bind("touchend" + S, function () {
                        clearInterval(l), l = setInterval(function () {
                            return .01 > Math.abs(r.x) && .01 > Math.abs(r.y) ? (clearInterval(l), void 0) : (t(30 * r.x, 30 * r.y), r.x *= .8, r.y *= .8, void 0)
                        }, 10)
                    })
                },
                H = function () {
                    a.bind("scroll" + S, function () {
                        D()
                    })
                },
                A = function () {
                    a.unbind(S), e(window).unbind(S), e(document).unbind(S), a.data("perfect-scrollbar", null), a.data("perfect-scrollbar-update", null), a.data("perfect-scrollbar-destroy", null), w.remove(), T.remove(), b.remove(), m.remove(), w = T = c = u = d = p = f = h = y = v = g = L = null
                },
                W = function (t) {
                    a.addClass("ie").addClass("ie" + t);
                    var n = function () {
                            var t = function () {
                                    e(this).addClass("hover")
                                },
                                n = function () {
                                    e(this).removeClass("hover")
                                };
                            a.bind("mouseenter" + S, t).bind("mouseleave" + S, n), b.bind("mouseenter" + S, t).bind("mouseleave" + S, n), m.bind("mouseenter" + S, t).bind("mouseleave" + S, n), w.bind("mouseenter" + S, t).bind("mouseleave" + S, n), T.bind("mouseenter" + S, t).bind("mouseleave" + S, n)
                        },
                        o = function () {
                            X = function () {
                                w.css({
                                    left: h + a.scrollLeft(),
                                    bottom: y,
                                    width: f
                                }), T.css({
                                    top: g + a.scrollTop(),
                                    right: L,
                                    height: v
                                }), w.hide().show(), T.hide().show()
                            }
                        };
                    6 === t && (n(), o())
                },
                q = "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch,
                F = function () {
                    var e = navigator.userAgent.toLowerCase().match(/(msie) ([\w.]+)/);
                    e && "msie" === e[1] && W(parseInt(e[2], 10)), D(), H(), I(), Y(), O(), q && E(), a.mousewheel && C(), l.useKeyboard && j(), a.data("perfect-scrollbar", a), a.data("perfect-scrollbar-update", D), a.data("perfect-scrollbar-destroy", A)
                };
            return F(), a
        })
    }
}),
function (e) {
    "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? module.exports = e : e(jQuery)
}(function (e) {
    function t(t) {
        var a = t || window.event,
            s = i.call(arguments, 1),
            c = 0,
            u = 0,
            d = 0,
            p = 0;
        if (t = e.event.fix(a), t.type = "mousewheel", "detail" in a && (d = -1 * a.detail), "wheelDelta" in a && (d = a.wheelDelta), "wheelDeltaY" in a && (d = a.wheelDeltaY), "wheelDeltaX" in a && (u = -1 * a.wheelDeltaX), "axis" in a && a.axis === a.HORIZONTAL_AXIS && (u = -1 * d, d = 0), c = 0 === d ? u : d, "deltaY" in a && (d = -1 * a.deltaY, c = d), "deltaX" in a && (u = a.deltaX, 0 === d && (c = -1 * u)), 0 !== d || 0 !== u) {
            if (1 === a.deltaMode) {
                var f = e.data(this, "mousewheel-line-height");
                c *= f, d *= f, u *= f
            } else if (2 === a.deltaMode) {
                var h = e.data(this, "mousewheel-page-height");
                c *= h, d *= h, u *= h
            }
            return p = Math.max(Math.abs(d), Math.abs(u)), (!l || l > p) && (l = p, o(a, p) && (l /= 40)), o(a, p) && (c /= 40, u /= 40, d /= 40), c = Math[c >= 1 ? "floor" : "ceil"](c / l), u = Math[u >= 1 ? "floor" : "ceil"](u / l), d = Math[d >= 1 ? "floor" : "ceil"](d / l), t.deltaX = u, t.deltaY = d, t.deltaFactor = l, t.deltaMode = 0, s.unshift(t, c, u, d), r && clearTimeout(r), r = setTimeout(n, 200), (e.event.dispatch || e.event.handle).apply(this, s)
        }
    }

    function n() {
        l = null
    }

    function o(e, t) {
        return u.settings.adjustOldDeltas && "mousewheel" === e.type && 0 === t % 120
    }
    var r, l, a = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"],
        s = "onwheel" in document || document.documentMode >= 9 ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"],
        i = Array.prototype.slice;
    if (e.event.fixHooks)
        for (var c = a.length; c;) e.event.fixHooks[a[--c]] = e.event.mouseHooks;
    var u = e.event.special.mousewheel = {
        version: "3.1.9",
        setup: function () {
            if (this.addEventListener)
                for (var n = s.length; n;) this.addEventListener(s[--n], t, !1);
            else this.onmousewheel = t;
            e.data(this, "mousewheel-line-height", u.getLineHeight(this)), e.data(this, "mousewheel-page-height", u.getPageHeight(this))
        },
        teardown: function () {
            if (this.removeEventListener)
                for (var e = s.length; e;) this.removeEventListener(s[--e], t, !1);
            else this.onmousewheel = null
        },
        getLineHeight: function (t) {
            return parseInt(e(t)["offsetParent" in e.fn ? "offsetParent" : "parent"]().css("fontSize"), 10)
        },
        getPageHeight: function (t) {
            return e(t).height()
        },
        settings: {
            adjustOldDeltas: !0
        }
    };
    e.fn.extend({
        mousewheel: function (e) {
            return e ? this.bind("mousewheel", e) : this.trigger("mousewheel")
        },
        unmousewheel: function (e) {
            return this.unbind("mousewheel", e)
        }
    })
});

/*!
 * imagesLoaded PACKAGED v3.0.4
 * JavaScript is all like "You images are done yet or what?"
 */
(function () {
    "use strict";

    function e() {}

    function t(e, t) {
        for (var n = e.length; n--;)
            if (e[n].listener === t) return n;
        return -1
    }
    var n = e.prototype;
    n.getListeners = function (e) {
        var t, n, i = this._getEvents();
        if ("object" == typeof e) {
            t = {};
            for (n in i) i.hasOwnProperty(n) && e.test(n) && (t[n] = i[n])
        } else t = i[e] || (i[e] = []);
        return t
    }, n.flattenListeners = function (e) {
        var t, n = [];
        for (t = 0; e.length > t; t += 1) n.push(e[t].listener);
        return n
    }, n.getListenersAsObject = function (e) {
        var t, n = this.getListeners(e);
        return n instanceof Array && (t = {}, t[e] = n), t || n
    }, n.addListener = function (e, n) {
        var i, r = this.getListenersAsObject(e),
            o = "object" == typeof n;
        for (i in r) r.hasOwnProperty(i) && -1 === t(r[i], n) && r[i].push(o ? n : {
            listener: n,
            once: !1
        });
        return this
    }, n.on = n.addListener, n.addOnceListener = function (e, t) {
        return this.addListener(e, {
            listener: t,
            once: !0
        })
    }, n.once = n.addOnceListener, n.defineEvent = function (e) {
        return this.getListeners(e), this
    }, n.defineEvents = function (e) {
        for (var t = 0; e.length > t; t += 1) this.defineEvent(e[t]);
        return this
    }, n.removeListener = function (e, n) {
        var i, r, o = this.getListenersAsObject(e);
        for (r in o) o.hasOwnProperty(r) && (i = t(o[r], n), -1 !== i && o[r].splice(i, 1));
        return this
    }, n.off = n.removeListener, n.addListeners = function (e, t) {
        return this.manipulateListeners(!1, e, t)
    }, n.removeListeners = function (e, t) {
        return this.manipulateListeners(!0, e, t)
    }, n.manipulateListeners = function (e, t, n) {
        var i, r, o = e ? this.removeListener : this.addListener,
            s = e ? this.removeListeners : this.addListeners;
        if ("object" != typeof t || t instanceof RegExp)
            for (i = n.length; i--;) o.call(this, t, n[i]);
        else
            for (i in t) t.hasOwnProperty(i) && (r = t[i]) && ("function" == typeof r ? o.call(this, i, r) : s.call(this, i, r));
        return this
    }, n.removeEvent = function (e) {
        var t, n = typeof e,
            i = this._getEvents();
        if ("string" === n) delete i[e];
        else if ("object" === n)
            for (t in i) i.hasOwnProperty(t) && e.test(t) && delete i[t];
        else delete this._events;
        return this
    }, n.emitEvent = function (e, t) {
        var n, i, r, o, s = this.getListenersAsObject(e);
        for (r in s)
            if (s.hasOwnProperty(r))
                for (i = s[r].length; i--;) n = s[r][i], o = n.listener.apply(this, t || []), (o === this._getOnceReturnValue() || n.once === !0) && this.removeListener(e, s[r][i].listener);
        return this
    }, n.trigger = n.emitEvent, n.emit = function (e) {
        var t = Array.prototype.slice.call(arguments, 1);
        return this.emitEvent(e, t)
    }, n.setOnceReturnValue = function (e) {
        return this._onceReturnValue = e, this
    }, n._getOnceReturnValue = function () {
        return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0
    }, n._getEvents = function () {
        return this._events || (this._events = {})
    }, "function" == typeof define && define.amd ? define(function () {
        return e
    }) : "undefined" != typeof module && module.exports ? module.exports = e : this.EventEmitter = e
}).call(this),
    function (e) {
        "use strict";
        var t = document.documentElement,
            n = function () {};
        t.addEventListener ? n = function (e, t, n) {
            e.addEventListener(t, n, !1)
        } : t.attachEvent && (n = function (t, n, i) {
            t[n + i] = i.handleEvent ? function () {
                var t = e.event;
                t.target = t.target || t.srcElement, i.handleEvent.call(i, t)
            } : function () {
                var n = e.event;
                n.target = n.target || n.srcElement, i.call(t, n)
            }, t.attachEvent("on" + n, t[n + i])
        });
        var i = function () {};
        t.removeEventListener ? i = function (e, t, n) {
            e.removeEventListener(t, n, !1)
        } : t.detachEvent && (i = function (e, t, n) {
            e.detachEvent("on" + t, e[t + n]);
            try {
                delete e[t + n]
            } catch (i) {
                e[t + n] = void 0
            }
        });
        var r = {
            bind: n,
            unbind: i
        };
        "function" == typeof define && define.amd ? define(r) : e.eventie = r
    }(this),
    function (e) {
        "use strict";

        function t(e, t) {
            for (var n in t) e[n] = t[n];
            return e
        }

        function n(e) {
            return "[object Array]" === c.call(e)
        }

        function i(e) {
            var t = [];
            if (n(e)) t = e;
            else if ("number" == typeof e.length)
                for (var i = 0, r = e.length; r > i; i++) t.push(e[i]);
            else t.push(e);
            return t
        }

        function r(e, n) {
            function r(e, n, s) {
                if (!(this instanceof r)) return new r(e, n);
                "string" == typeof e && (e = document.querySelectorAll(e)), this.elements = i(e), this.options = t({}, this.options), "function" == typeof n ? s = n : t(this.options, n), s && this.on("always", s), this.getImages(), o && (this.jqDeferred = new o.Deferred);
                var a = this;
                setTimeout(function () {
                    a.check()
                })
            }

            function c(e) {
                this.img = e
            }
            r.prototype = new e, r.prototype.options = {}, r.prototype.getImages = function () {
                this.images = [];
                for (var e = 0, t = this.elements.length; t > e; e++) {
                    var n = this.elements[e];
                    "IMG" === n.nodeName && this.addImage(n);
                    for (var i = n.querySelectorAll("img"), r = 0, o = i.length; o > r; r++) {
                        var s = i[r];
                        this.addImage(s)
                    }
                }
            }, r.prototype.addImage = function (e) {
                var t = new c(e);
                this.images.push(t)
            }, r.prototype.check = function () {
                function e(e, r) {
                    return t.options.debug && a && s.log("confirm", e, r), t.progress(e), n++, n === i && t.complete(), !0
                }
                var t = this,
                    n = 0,
                    i = this.images.length;
                if (this.hasAnyBroken = !1, !i) return this.complete(), void 0;
                for (var r = 0; i > r; r++) {
                    var o = this.images[r];
                    o.on("confirm", e), o.check()
                }
            }, r.prototype.progress = function (e) {
                this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded;
                var t = this;
                setTimeout(function () {
                    t.emit("progress", t, e), t.jqDeferred && t.jqDeferred.notify(t, e)
                })
            }, r.prototype.complete = function () {
                var e = this.hasAnyBroken ? "fail" : "done";
                this.isComplete = !0;
                var t = this;
                setTimeout(function () {
                    if (t.emit(e, t), t.emit("always", t), t.jqDeferred) {
                        var n = t.hasAnyBroken ? "reject" : "resolve";
                        t.jqDeferred[n](t)
                    }
                })
            }, o && (o.fn.imagesLoaded = function (e, t) {
                var n = new r(this, e, t);
                return n.jqDeferred.promise(o(this))
            });
            var f = {};
            return c.prototype = new e, c.prototype.check = function () {
                var e = f[this.img.src];
                if (e) return this.useCached(e), void 0;
                if (f[this.img.src] = this, this.img.complete && void 0 !== this.img.naturalWidth) return this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), void 0;
                var t = this.proxyImage = new Image;
                n.bind(t, "load", this), n.bind(t, "error", this), t.src = this.img.src
            }, c.prototype.useCached = function (e) {
                if (e.isConfirmed) this.confirm(e.isLoaded, "cached was confirmed");
                else {
                    var t = this;
                    e.on("confirm", function (e) {
                        return t.confirm(e.isLoaded, "cache emitted confirmed"), !0
                    })
                }
            }, c.prototype.confirm = function (e, t) {
                this.isConfirmed = !0, this.isLoaded = e, this.emit("confirm", this, t)
            }, c.prototype.handleEvent = function (e) {
                var t = "on" + e.type;
                this[t] && this[t](e)
            }, c.prototype.onload = function () {
                this.confirm(!0, "onload"), this.unbindProxyEvents()
            }, c.prototype.onerror = function () {
                this.confirm(!1, "onerror"), this.unbindProxyEvents()
            }, c.prototype.unbindProxyEvents = function () {
                n.unbind(this.proxyImage, "load", this), n.unbind(this.proxyImage, "error", this)
            }, r
        }
        var o = e.jQuery,
            s = e.console,
            a = s !== void 0,
            c = Object.prototype.toString;
        "function" == typeof define && define.amd ? define(["eventEmitter/EventEmitter", "eventie/eventie"], r) : e.imagesLoaded = r(e.EventEmitter, e.eventie)
    }(window);


/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

;(function($){
	$.fn.superfish = function(op){

		var sf = $.fn.superfish,
			c = sf.c,
			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
			over = function(){
				var $$ = $(this), menu = getMenu($$);
				clearTimeout(menu.sfTimer);
				$$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this), menu = getMenu($$), o = sf.op;
				clearTimeout(menu.sfTimer);
				menu.sfTimer=setTimeout(function(){
					o.retainPath=($.inArray($$[0],o.$path)>-1);
					$$.hideSuperfishUl();
					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
				},o.delay);	
			},
			getMenu = function($menu){
				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
				sf.op = sf.o[menu.serial];
				return menu;
			},
			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
			
		return this.each(function() {
			var s = this.serial = sf.o.length;
			var o = $.extend({},sf.defaults,op);
			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
			});
			sf.o[s] = sf.op = o;
			
			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
				if (o.autoArrows) addArrow( $('>a:first-child',this) );
			})
			.not('.'+c.bcClass)
				.hideSuperfishUl();
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			o.onInit.call(this);
			
		}).each(function() {
			var menuClasses = [c.menuClass];
			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
			$(this).addClass(menuClasses.join(' '));
		});
	};

	var sf = $.fn.superfish;
	sf.o = [];
	sf.op = {};
	sf.IE7fix = function(){
		var o = sf.op;
		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
			this.toggleClass(sf.c.shadowClass+'-off');
		};
	sf.c = {
		bcClass     : 'sf-breadcrumb',
		menuClass   : 'sf-js-enabled',
		anchorClass : 'sf-with-ul',
		arrowClass  : 'sf-sub-indicator',
		shadowClass : 'sf-shadow'
	};
	sf.defaults = {
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		pathLevels	: 1,
		delay		: 800,
		animation	: {opacity:'show'},
		speed		: 'normal',
		autoArrows	: true,
		dropShadows : true,
		disableHI	: false,		// true disables hoverIntent detection
		onInit		: function(){}, // callback functions
		onBeforeShow: function(){},
		onShow		: function(){},
		onHide		: function(){}
	};
	$.fn.extend({
		hideSuperfishUl : function(){
			var o = sf.op,
				not = (o.retainPath===true) ? o.$path : '';
			o.retainPath = false;
			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility','hidden');
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			var o = sf.op,
				sh = sf.c.shadowClass+'-off',
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility','visible');
			sf.IE7fix.call($ul);
			o.onBeforeShow.call($ul);
			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
			return this;
		}
	});

})(jQuery);


/*
 * Supersubs v0.2b - jQuery plugin
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 *
 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
 * their longest list item children. If you use this, please expect bugs and report them
 * to the jQuery Google Group with the word 'Superfish' in the subject line.
 *
 */

;(function($){ // $ will refer to jQuery within this closure

	$.fn.supersubs = function(options){
		var opts = $.extend({}, $.fn.supersubs.defaults, options);
		// return original object to support chaining
		return this.each(function() {
			// cache selections
			var $$ = $(this);
			// support metadata
			var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
			// get the font size of menu.
			// .css('fontSize') returns various results cross-browser, so measure an em dash instead
			var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({
				'padding' : 0,
				'position' : 'absolute',
				'top' : '-999em',
				'width' : 'auto'
			}).appendTo($$).width(); //clientWidth is faster, but was incorrect here
			// remove em dash
			$('#menu-fontsize').remove();
			// cache all ul elements
			$ULs = $$.find('ul');
			// loop through each ul in menu
			$ULs.each(function(i) {	
				// cache this ul
				var $ul = $ULs.eq(i);
				// get all (li) children of this ul
				var $LIs = $ul.children();
				// get all anchor grand-children
				var $As = $LIs.children('a');
				// force content to one line and save current float property
				var liFloat = $LIs.css('white-space','nowrap').css('float');
				// remove width restrictions and floats so elements remain vertically stacked
				var emWidth = $ul.add($LIs).add($As).css({
					'float' : 'none',
					'width'	: 'auto'
				})
				// this ul will now be shrink-wrapped to longest li due to position:absolute
				// so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
				.end().end()[0].clientWidth / fontsize;
				// add more width to ensure lines don't turn over at certain sizes in various browsers
				emWidth += o.extraWidth;
				// restrict to at least minWidth and at most maxWidth
				if (emWidth > o.maxWidth)		{ emWidth = o.maxWidth; }
				else if (emWidth < o.minWidth)	{ emWidth = o.minWidth; }
				emWidth += 'em';
				// set ul to width in ems
				$ul.css('width',emWidth);
				// restore li floats to avoid IE bugs
				// set li width to full width of this ul
				// revert white-space to normal
				$LIs.css({
					'float' : liFloat,
					'width' : '100%',
					'white-space' : 'normal'
				})
				// update offset position of descendant ul to reflect new width of parent
				.each(function(){
					var $childUl = $('>ul',this);
					var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right';
					$childUl.css(offsetDirection,emWidth);
				});
			});
			
		});
	};
	// expose defaults
	$.fn.supersubs.defaults = {
		minWidth		: 9,		// requires em unit.
		maxWidth		: 25,		// requires em unit.
		extraWidth		: 0			// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
	};
	
})(jQuery); // plugin code ends

/*
 * jQuery FlexSlider v2.0
 * Copyright 2012 WooThemes
 * Contributing Author: Tyler Smith
 */
;
(function (d) {
    d.flexslider = function (h, k) {
        var a = d(h),
            c = d.extend({}, d.flexslider.defaults, k),
            e = c.namespace,
            o = "ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch,
            s = o ? "touchend" : "click",
            l = "vertical" === c.direction,
            m = c.reverse,
            i = 0 < c.itemWidth,
            p = "fade" === c.animation,
            r = "" !== c.asNavFor,
            f = {};
        d.data(h, "flexslider", a);
        f = {
            init: function () {
                a.animating = !1;
                a.currentSlide = c.startAt;
                a.animatingTo = a.currentSlide;
                a.atEnd = 0 === a.currentSlide || a.currentSlide === a.last;
                a.containerSelector = c.selector.substr(0,
                    c.selector.search(" "));
                a.slides = d(c.selector, a);
                a.container = d(a.containerSelector, a);
                a.count = a.slides.length;
                a.syncExists = 0 < d(c.sync).length;
                "slide" === c.animation && (c.animation = "swing");
                a.prop = l ? "top" : "marginLeft";
                a.args = {};
                a.manualPause = !1;
                a.transitions = !c.video && !p && c.useCSS && function () {
                    var b = document.createElement("div"),
                        c = ["perspectiveProperty", "WebkitPerspective", "MozPerspective", "OPerspective", "msPerspective"],
                        d;
                    for (d in c)
                        if (b.style[c[d]] !== void 0) {
                            a.pfx = c[d].replace("Perspective", "").toLowerCase();
                            a.prop = "-" + a.pfx + "-transform";
                            return true
                        }
                    return false
                }();
                "" !== c.controlsContainer && (a.controlsContainer = 0 < d(c.controlsContainer).length && d(c.controlsContainer));
                "" !== c.manualControls && (a.manualControls = 0 < d(c.manualControls).length && d(c.manualControls));
                c.randomize && (a.slides.sort(function () {
                    return Math.round(Math.random()) - 0.5
                }), a.container.empty().append(a.slides));
                a.doMath();
                r && f.asNav.setup();
                a.setup("init");
                c.controlNav && f.controlNav.setup();
                c.directionNav && f.directionNav.setup();
                c.keyboard &&
                    (1 === d(a.containerSelector).length || c.multipleKeyboard) && d(document).bind("keyup", function (b) {
                        b = b.keyCode;
                        if (!a.animating && (b === 39 || b === 37)) {
                            b = b === 39 ? a.getTarget("next") : b === 37 ? a.getTarget("prev") : false;
                            a.flexAnimate(b, c.pauseOnAction)
                        }
                    });
                c.mousewheel && a.bind("mousewheel", function (b, g) {
                    b.preventDefault();
                    var d = g < 0 ? a.getTarget("next") : a.getTarget("prev");
                    a.flexAnimate(d, c.pauseOnAction)
                });
                c.pausePlay && f.pausePlay.setup();
                c.slideshow && (c.pauseOnHover && a.hover(function () {
                    a.pause()
                }, function () {
                    a.manualPause ||
                        a.play()
                }), 0 < c.initDelay ? setTimeout(a.play, c.initDelay) : a.play());
                o && c.touch && f.touch();
                (!p || p && c.smoothHeight) && d(window).bind("resize focus", f.resize);
                setTimeout(function () {
                    c.start(a)
                }, 200)
            },
            asNav: {
                setup: function () {
                    a.asNav = !0;
                    a.animatingTo = Math.floor(a.currentSlide / a.move);
                    a.currentItem = a.currentSlide;
                    a.slides.removeClass(e + "active-slide").eq(a.currentItem).addClass(e + "active-slide");
                    a.slides.click(function (b) {
                        b.preventDefault();
                        var b = d(this),
                            g = b.index();
                        !d(c.asNavFor).data("flexslider").animating &&
                            !b.hasClass("active") && (a.direction = a.currentItem < g ? "next" : "prev", a.flexAnimate(g, c.pauseOnAction, !1, !0, !0))
                    })
                }
            },
            controlNav: {
                setup: function () {
                    a.manualControls ? f.controlNav.setupManual() : f.controlNav.setupPaging()
                },
                setupPaging: function () {
                    var b = 1,
                        g;
                    a.controlNavScaffold = d('<ol class="' + e + "control-nav " + e + ("thumbnails" === c.controlNav ? "control-thumbs" : "control-paging") + '"></ol>');
                    if (1 < a.pagingCount)
                        for (var q = 0; q < a.pagingCount; q++) g = "thumbnails" === c.controlNav ? '<img src="' + a.slides.eq(q).attr("data-thumb") +
                            '"/>' : "<a>" + b + "</a>", a.controlNavScaffold.append("<li>" + g + "</li>"), b++;
                    a.controlsContainer ? d(a.controlsContainer).append(a.controlNavScaffold) : a.append(a.controlNavScaffold);
                    f.controlNav.set();
                    f.controlNav.active();
                    a.controlNavScaffold.delegate("a, img", s, function (b) {
                        b.preventDefault();
                        var b = d(this),
                            g = a.controlNav.index(b);
                        b.hasClass(e + "active") || (a.direction = g > a.currentSlide ? "next" : "prev", a.flexAnimate(g, c.pauseOnAction))
                    });
                    o && a.controlNavScaffold.delegate("a", "click touchstart", function (a) {
                        a.preventDefault()
                    })
                },
                setupManual: function () {
                    a.controlNav = a.manualControls;
                    f.controlNav.active();
                    a.controlNav.live(s, function (b) {
                        b.preventDefault();
                        var b = d(this),
                            g = a.controlNav.index(b);
                        b.hasClass(e + "active") || (g > a.currentSlide ? a.direction = "next" : a.direction = "prev", a.flexAnimate(g, c.pauseOnAction))
                    });
                    o && a.controlNav.live("click touchstart", function (a) {
                        a.preventDefault()
                    })
                },
                set: function () {
                    a.controlNav = d("." + e + "control-nav li " + ("thumbnails" === c.controlNav ? "img" : "a"), a.controlsContainer ? a.controlsContainer : a)
                },
                active: function () {
                    a.controlNav.removeClass(e +
                        "active").eq(a.animatingTo).addClass(e + "active")
                },
                update: function (b, c) {
                    1 < a.pagingCount && "add" === b ? a.controlNavScaffold.append(d("<li><a>" + a.count + "</a></li>")) : 1 === a.pagingCount ? a.controlNavScaffold.find("li").remove() : a.controlNav.eq(c).closest("li").remove();
                    f.controlNav.set();
                    1 < a.pagingCount && a.pagingCount !== a.controlNav.length ? a.update(c, b) : f.controlNav.active()
                }
            },
            directionNav: {
                setup: function () {
                    var b = d('<ul class="' + e + 'direction-nav"><li><a class="' + e + 'prev" href="#">' + c.prevText + '</a></li><li><a class="' +
                        e + 'next" href="#">' + c.nextText + "</a></li></ul>");
                    a.controlsContainer ? (d(a.controlsContainer).append(b), a.directionNav = d("." + e + "direction-nav li a", a.controlsContainer)) : (a.append(b), a.directionNav = d("." + e + "direction-nav li a", a));
                    f.directionNav.update();
                    a.directionNav.bind(s, function (b) {
                        b.preventDefault();
                        b = d(this).hasClass(e + "next") ? a.getTarget("next") : a.getTarget("prev");
                        a.flexAnimate(b, c.pauseOnAction)
                    });
                    o && a.directionNav.bind("click touchstart", function (a) {
                        a.preventDefault()
                    })
                },
                update: function () {
                    var b =
                        e + "disabled";
                    c.animationLoop || (1 === a.pagingCount ? a.directionNav.addClass(b) : 0 === a.animatingTo ? a.directionNav.removeClass(b).filter("." + e + "prev").addClass(b) : a.animatingTo === a.last ? a.directionNav.removeClass(b).filter("." + e + "next").addClass(b) : a.directionNav.removeClass(b))
                }
            },
            pausePlay: {
                setup: function () {
                    var b = d('<div class="' + e + 'pauseplay"><a></a></div>');
                    a.controlsContainer ? (a.controlsContainer.append(b), a.pausePlay = d("." + e + "pauseplay a", a.controlsContainer)) : (a.append(b), a.pausePlay = d("." + e + "pauseplay a",
                        a));
                    f.pausePlay.update(c.slideshow ? e + "pause" : e + "play");
                    a.pausePlay.bind(s, function (b) {
                        b.preventDefault();
                        if (d(this).hasClass(e + "pause")) {
                            a.pause();
                            a.manualPause = true
                        } else {
                            a.play();
                            a.manualPause = false
                        }
                    });
                    o && a.pausePlay.bind("click touchstart", function (a) {
                        a.preventDefault()
                    })
                },
                update: function (b) {
                    "play" === b ? a.pausePlay.removeClass(e + "pause").addClass(e + "play").text(c.playText) : a.pausePlay.removeClass(e + "play").addClass(e + "pause").text(c.pauseText)
                }
            },
            touch: function () {
                function b(b) {
                    j = l ? d - b.touches[0].pageY :
                        d - b.touches[0].pageX;
                    o = l ? Math.abs(j) < Math.abs(b.touches[0].pageX - e) : Math.abs(j) < Math.abs(b.touches[0].pageY - e);
                    if (!o || 500 < Number(new Date) - k) b.preventDefault(), !p && a.transitions && (c.animationLoop || (j /= 0 === a.currentSlide && 0 > j || a.currentSlide === a.last && 0 < j ? Math.abs(j) / n + 2 : 1), a.setProps(f + j, "setTouch"))
                }

                function g() {
                    if (a.animatingTo === a.currentSlide && !o && null !== j) {
                        var i = m ? -j : j,
                            l = 0 < i ? a.getTarget("next") : a.getTarget("prev");
                        a.canAdvance(l) && (550 > Number(new Date) - k && 20 < Math.abs(i) || Math.abs(i) > n / 2) ? a.flexAnimate(l,
                            c.pauseOnAction) : a.flexAnimate(a.currentSlide, c.pauseOnAction, !0)
                    }
                    h.removeEventListener("touchmove", b, !1);
                    h.removeEventListener("touchend", g, !1);
                    f = j = e = d = null
                }
                var d, e, f, n, j, k, o = !1;
                h.addEventListener("touchstart", function (j) {
                    a.animating ? j.preventDefault() : 1 === j.touches.length && (a.pause(), n = l ? a.h : a.w, k = Number(new Date), f = i && m && a.animatingTo === a.last ? 0 : i && m ? a.limit - (a.itemW + c.itemMargin) * a.move * a.animatingTo : i && a.currentSlide === a.last ? a.limit : i ? (a.itemW + c.itemMargin) * a.move * a.currentSlide : m ? (a.last - a.currentSlide +
                        a.cloneOffset) * n : (a.currentSlide + a.cloneOffset) * n, d = l ? j.touches[0].pageY : j.touches[0].pageX, e = l ? j.touches[0].pageX : j.touches[0].pageY, h.addEventListener("touchmove", b, !1), h.addEventListener("touchend", g, !1))
                }, !1)
            },
            resize: function () {
                !a.animating && a.is(":visible") && (i || a.doMath(), p ? f.smoothHeight() : i ? (a.slides.width(a.computedW), a.update(a.pagingCount), a.setProps()) : l ? (a.viewport.height(a.h), a.setProps(a.h, "setTotal")) : (c.smoothHeight && f.smoothHeight(), a.newSlides.width(a.computedW), a.setProps(a.computedW,
                    "setTotal")))
            },
            smoothHeight: function (b) {
                if (!l || p) {
                    var c = p ? a : a.viewport;
                    b ? c.animate({
                        height: a.slides.eq(a.animatingTo).height()
                    }, b) : c.height(a.slides.eq(a.animatingTo).height())
                }
            },
            sync: function (b) {
                var g = d(c.sync).data("flexslider"),
                    e = a.animatingTo;
                switch (b) {
                case "animate":
                    g.flexAnimate(e, c.pauseOnAction, !1, !0);
                    break;
                case "play":
                    !g.playing && !g.asNav && g.play();
                    break;
                case "pause":
                    g.pause()
                }
            }
        };
        a.flexAnimate = function (b, g, q, h, k) {
            if (!a.animating && (a.canAdvance(b) || q) && a.is(":visible")) {
                if (r && h)
                    if (q = d(c.asNavFor).data("flexslider"),
                        a.atEnd = 0 === b || b === a.count - 1, q.flexAnimate(b, !0, !1, !0, k), a.direction = a.currentItem < b ? "next" : "prev", q.direction = a.direction, Math.ceil((b + 1) / a.visible) - 1 !== a.currentSlide && 0 !== b) a.currentItem = b, a.slides.removeClass(e + "active-slide").eq(b).addClass(e + "active-slide"), b = Math.floor(b / a.visible);
                    else return a.currentItem = b, a.slides.removeClass(e + "active-slide").eq(b).addClass(e + "active-slide"), !1;
                a.animating = !0;
                a.animatingTo = b;
                c.before(a);
                g && a.pause();
                a.syncExists && !k && f.sync("animate");
                c.controlNav && f.controlNav.active();
                i || a.slides.removeClass(e + "active-slide").eq(b).addClass(e + "active-slide");
                a.atEnd = 0 === b || b === a.last;
                c.directionNav && f.directionNav.update();
                b === a.last && (c.end(a), c.animationLoop || a.pause());
                if (p) a.slides.eq(a.currentSlide).fadeOut(c.animationSpeed, c.easing), a.slides.eq(b).fadeIn(c.animationSpeed, c.easing, a.wrapup);
                else {
                    var n = l ? a.slides.filter(":first").height() : a.computedW;
                    i ? (b = c.itemWidth > a.w ? 2 * c.itemMargin : c.itemMargin, b = (a.itemW + b) * a.move * a.animatingTo, b = b > a.limit && 1 !== a.visible ? a.limit : b) : b =
                        0 === a.currentSlide && b === a.count - 1 && c.animationLoop && "next" !== a.direction ? m ? (a.count + a.cloneOffset) * n : 0 : a.currentSlide === a.last && 0 === b && c.animationLoop && "prev" !== a.direction ? m ? 0 : (a.count + 1) * n : m ? (a.count - 1 - b + a.cloneOffset) * n : (b + a.cloneOffset) * n;
                    a.setProps(b, "", c.animationSpeed);
                    if (a.transitions) {
                        if (!c.animationLoop || !a.atEnd) a.animating = !1, a.currentSlide = a.animatingTo;
                        a.container.unbind("webkitTransitionEnd transitionend");
                        a.container.bind("webkitTransitionEnd transitionend", function () {
                            a.wrapup(n)
                        })
                    } else a.container.animate(a.args,
                        c.animationSpeed, c.easing, function () {
                            a.wrapup(n)
                        })
                }
                c.smoothHeight && f.smoothHeight(c.animationSpeed)
            }
        };
        a.wrapup = function (b) {
            !p && !i && (0 === a.currentSlide && a.animatingTo === a.last && c.animationLoop ? a.setProps(b, "jumpEnd") : a.currentSlide === a.last && (0 === a.animatingTo && c.animationLoop) && a.setProps(b, "jumpStart"));
            a.animating = !1;
            a.currentSlide = a.animatingTo;
            c.after(a)
        };
        a.animateSlides = function () {
            a.animating || a.flexAnimate(a.getTarget("next"))
        };
        a.pause = function () {
            clearInterval(a.animatedSlides);
            a.playing = !1;
            c.pausePlay && f.pausePlay.update("play");
            a.syncExists && f.sync("pause")
        };
        a.play = function () {
            a.animatedSlides = setInterval(a.animateSlides, c.slideshowSpeed);
            a.playing = !0;
            c.pausePlay && f.pausePlay.update("pause");
            a.syncExists && f.sync("play")
        };
        a.canAdvance = function (b) {
            var d = r ? a.pagingCount - 1 : a.last;
            return r && 0 === a.currentItem && b === a.pagingCount - 1 && "next" !== a.direction ? !1 : b === a.currentSlide && !r ? !1 : c.animationLoop ? !0 : a.atEnd && 0 === a.currentSlide && b === d && "next" !== a.direction ? !1 : a.atEnd && a.currentSlide === d && 0 ===
                b && "next" === a.direction ? !1 : !0
        };
        a.getTarget = function (b) {
            a.direction = b;
            return "next" === b ? a.currentSlide === a.last ? 0 : a.currentSlide + 1 : 0 === a.currentSlide ? a.last : a.currentSlide - 1
        };
        a.setProps = function (b, d, e) {
            var f = function () {
                var e = b ? b : (a.itemW + c.itemMargin) * a.move * a.animatingTo;
                return -1 * function () {
                    if (i) return "setTouch" === d ? b : m && a.animatingTo === a.last ? 0 : m ? a.limit - (a.itemW + c.itemMargin) * a.move * a.animatingTo : a.animatingTo === a.last ? a.limit : e;
                    switch (d) {
                    case "setTotal":
                        return m ? (a.count - 1 - a.currentSlide + a.cloneOffset) *
                            b : (a.currentSlide + a.cloneOffset) * b;
                    case "setTouch":
                        return b;
                    case "jumpEnd":
                        return m ? b : a.count * b;
                    case "jumpStart":
                        return m ? a.count * b : b;
                    default:
                        return b
                    }
                }() + "px"
            }();
            a.transitions && (f = l ? "translate3d(0," + f + ",0)" : "translate3d(" + f + ",0,0)", e = void 0 !== e ? e / 1E3 + "s" : "0s", a.container.css("-" + a.pfx + "-transition-duration", e));
            a.args[a.prop] = f;
            (a.transitions || void 0 === e) && a.container.css(a.args)
        };
        a.setup = function (b) {
            if (p) a.slides.css({
                    width: "100%",
                    "float": "left",
                    marginRight: "-100%",
                    position: "relative"
                }), "init" ===
                b && a.slides.eq(a.currentSlide).fadeIn(c.animationSpeed, c.easing), c.smoothHeight && f.smoothHeight();
            else {
                var g, h;
                "init" === b && (a.viewport = d('<div class="flex-viewport"></div>').css({
                    overflow: "hidden",
                    position: "relative"
                }).appendTo(a).append(a.container), a.cloneCount = 0, a.cloneOffset = 0, m && (h = d.makeArray(a.slides).reverse(), a.slides = d(h), a.container.empty().append(a.slides)));
                c.animationLoop && !i && (a.cloneCount = 2, a.cloneOffset = 1, "init" !== b && a.container.find(".clone").remove(), a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone")));
                a.newSlides = d(c.selector, a);
                g = m ? a.count - 1 - a.currentSlide + a.cloneOffset : a.currentSlide + a.cloneOffset;
                l && !i ? (a.container.height(200 * (a.count + a.cloneCount) + "%").css("position", "absolute").width("100%"), setTimeout(function () {
                    a.newSlides.css({
                        display: "block"
                    });
                    a.doMath();
                    a.viewport.height(a.h);
                    a.setProps(g * a.h, "init")
                }, "init" === b ? 100 : 0)) : (a.container.width(200 * (a.count + a.cloneCount) + "%"), a.setProps(g * a.computedW, "init"), setTimeout(function () {
                    a.doMath();
                    a.newSlides.css({
                        width: a.computedW,
                        "float": "left",
                        display: "block"
                    });
                    c.smoothHeight && f.smoothHeight()
                }, "init" === b ? 100 : 0))
            }
            i || a.slides.removeClass(e + "active-slide").eq(a.currentSlide).addClass(e + "active-slide")
        };
        a.doMath = function () {
            var b = a.slides.first(),
                d = c.itemMargin,
                e = c.minItems,
                f = c.maxItems;
            a.w = a.width();
            a.h = b.height();
            a.boxPadding = b.outerWidth() - b.width();
            i ? (a.itemT = c.itemWidth + d, a.minW = e ? e * a.itemT : a.w, a.maxW = f ? f * a.itemT : a.w, a.itemW = a.minW > a.w ? (a.w - d * e) / e : a.maxW < a.w ? (a.w - d * f) / f : c.itemWidth > a.w ? a.w : c.itemWidth, a.visible = Math.floor(a.w / (a.itemW +
                d)), a.move = 0 < c.move && c.move < a.visible ? c.move : a.visible, a.pagingCount = Math.ceil((a.count - a.visible) / a.move + 1), a.last = a.pagingCount - 1, a.limit = 1 === a.pagingCount ? 0 : c.itemWidth > a.w ? (a.itemW + 2 * d) * a.count - a.w - d : (a.itemW + d) * a.count - a.w) : (a.itemW = a.w, a.pagingCount = a.count, a.last = a.count - 1);
            a.computedW = a.itemW - a.boxPadding
        };
        a.update = function (b, d) {
            a.doMath();
            i || (b < a.currentSlide ? a.currentSlide += 1 : b <= a.currentSlide && 0 !== b && (a.currentSlide -= 1), a.animatingTo = a.currentSlide);
            if (c.controlNav && !a.manualControls)
                if ("add" ===
                    d && !i || a.pagingCount > a.controlNav.length) f.controlNav.update("add");
                else if ("remove" === d && !i || a.pagingCount < a.controlNav.length) i && a.currentSlide > a.last && (a.currentSlide -= 1, a.animatingTo -= 1), f.controlNav.update("remove", a.last);
            c.directionNav && f.directionNav.update()
        };
        a.addSlide = function (b, e) {
            var f = d(b);
            a.count += 1;
            a.last = a.count - 1;
            l && m ? void 0 !== e ? a.slides.eq(a.count - e).after(f) : a.container.prepend(f) : void 0 !== e ? a.slides.eq(e).before(f) : a.container.append(f);
            a.update(e, "add");
            a.slides = d(c.selector +
                ":not(.clone)", a);
            a.setup();
            c.added(a)
        };
        a.removeSlide = function (b) {
            var e = isNaN(b) ? a.slides.index(d(b)) : b;
            a.count -= 1;
            a.last = a.count - 1;
            isNaN(b) ? d(b, a.slides).remove() : l && m ? a.slides.eq(a.last).remove() : a.slides.eq(b).remove();
            a.doMath();
            a.update(e, "remove");
            a.slides = d(c.selector + ":not(.clone)", a);
            a.setup();
            c.removed(a)
        };
        f.init()
    };
    d.flexslider.defaults = {
        namespace: "flex-",
        selector: ".slides > li",
        animation: "fade",
        easing: "swing",
        direction: "horizontal",
        reverse: !1,
        animationLoop: !0,
        smoothHeight: !1,
        startAt: 0,
        slideshow: !0,
        slideshowSpeed: 7E3,
        animationSpeed: 600,
        initDelay: 0,
        randomize: !1,
        pauseOnAction: !0,
        pauseOnHover: !1,
        useCSS: !0,
        touch: !0,
        video: !1,
        controlNav: !0,
        directionNav: !0,
        prevText: "Previous",
        nextText: "Next",
        keyboard: !0,
        multipleKeyboard: !1,
        mousewheel: !1,
        pausePlay: !1,
        pauseText: "Pause",
        playText: "Play",
        controlsContainer: "",
        manualControls: "",
        sync: "",
        asNavFor: "",
        itemWidth: 0,
        itemMargin: 0,
        minItems: 0,
        maxItems: 0,
        move: 0,
        start: function () {},
        before: function () {},
        after: function () {},
        end: function () {},
        added: function () {},
        removed: function () {}
    };
    d.fn.flexslider = function (h) {
        h = h || {};
        if ("object" === typeof h) return this.each(function () {
            var a = d(this),
                c = a.find(h.selector ? h.selector : ".slides > li");
            1 === c.length ? (c.fadeIn(400), h.start && h.start(a)) : void 0 === a.data("flexslider") && new d.flexslider(this, h)
        });
        var k = d(this).data("flexslider");
        switch (h) {
        case "play":
            k.play();
            break;
        case "pause":
            k.pause();
            break;
        case "next":
            k.flexAnimate(k.getTarget("next"), !0);
            break;
        case "prev":
        case "previous":
            k.flexAnimate(k.getTarget("prev"), !0);
            break;
        default:
            "number" === typeof h && k.flexAnimate(h, !0)
        }
    }
})(jQuery);

/*!
 * jQuery Form Plugin
 * version: 3.50.0-2014.02.05
 * Requires jQuery v1.5 or later
 * Copyright (c) 2013 M. Alsup
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Project repository: https://github.com/malsup/form
 * Dual licensed under the MIT and GPL licenses.
 * https://github.com/malsup/form#copyright-and-license
 */
(function (a) {
    if (typeof define === "function" && define.amd) {
        define(["jquery"], a)
    } else {
        a((typeof (jQuery) != "undefined") ? jQuery : window.Zepto)
    }
}(function (f) {
    var c = {};
    c.fileapi = f("<input type='file'/>").get(0).files !== undefined;
    c.formdata = window.FormData !== undefined;
    var e = !!f.fn.prop;
    f.fn.attr2 = function () {
        if (!e) {
            return this.attr.apply(this, arguments)
        }
        var g = this.prop.apply(this, arguments);
        if ((g && g.jquery) || typeof g === "string") {
            return g
        }
        return this.attr.apply(this, arguments)
    };
    f.fn.ajaxSubmit = function (j) {
        if (!this.length) {
            d("ajaxSubmit: skipping submit process - no element selected");
            return this
        }
        var i, C, m, o = this;
        if (typeof j == "function") {
            j = {
                success: j
            }
        } else {
            if (j === undefined) {
                j = {}
            }
        }
        i = j.type || this.attr2("method");
        C = j.url || this.attr2("action");
        m = (typeof C === "string") ? f.trim(C) : "";
        m = m || window.location.href || "";
        if (m) {
            m = (m.match(/^([^#]+)/) || [])[1]
        }
        j = f.extend(true, {
            url: m,
            success: f.ajaxSettings.success,
            type: i || f.ajaxSettings.type,
            iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank"
        }, j);
        var u = {};
        this.trigger("form-pre-serialize", [this, j, u]);
        if (u.veto) {
            d("ajaxSubmit: submit vetoed via form-pre-serialize trigger");
            return this
        }
        if (j.beforeSerialize && j.beforeSerialize(this, j) === false) {
            d("ajaxSubmit: submit aborted via beforeSerialize callback");
            return this
        }
        var n = j.traditional;
        if (n === undefined) {
            n = f.ajaxSettings.traditional
        }
        var s = [];
        var E, F = this.formToArray(j.semantic, s);
        if (j.data) {
            j.extraData = j.data;
            E = f.param(j.data, n)
        }
        if (j.beforeSubmit && j.beforeSubmit(F, this, j) === false) {
            d("ajaxSubmit: submit aborted via beforeSubmit callback");
            return this
        }
        this.trigger("form-submit-validate", [F, this, j, u]);
        if (u.veto) {
            d("ajaxSubmit: submit vetoed via form-submit-validate trigger");
            return this
        }
        var y = f.param(F, n);
        if (E) {
            y = (y ? (y + "&" + E) : E)
        }
        if (j.type.toUpperCase() == "GET") {
            j.url += (j.url.indexOf("?") >= 0 ? "&" : "?") + y;
            j.data = null
        } else {
            j.data = y
        }
        var H = [];
        if (j.resetForm) {
            H.push(function () {
                o.resetForm()
            })
        }
        if (j.clearForm) {
            H.push(function () {
                o.clearForm(j.includeHidden)
            })
        }
        if (!j.dataType && j.target) {
            var l = j.success || function () {};
            H.push(function (q) {
                var k = j.replaceTarget ? "replaceWith" : "html";
                f(j.target)[k](q).each(l, arguments)
            })
        } else {
            if (j.success) {
                H.push(j.success)
            }
        }
        j.success = function (K, q, L) {
            var J = j.context || this;
            for (var I = 0, k = H.length; I < k; I++) {
                H[I].apply(J, [K, q, L || o, o])
            }
        };
        if (j.error) {
            var z = j.error;
            j.error = function (J, k, q) {
                var I = j.context || this;
                z.apply(I, [J, k, q, o])
            }
        }
        if (j.complete) {
            var h = j.complete;
            j.complete = function (I, k) {
                var q = j.context || this;
                h.apply(q, [I, k, o])
            }
        }
        var D = f("input[type=file]:enabled", this).filter(function () {
            return f(this).val() !== ""
        });
        var p = D.length > 0;
        var B = "multipart/form-data";
        var x = (o.attr("enctype") == B || o.attr("encoding") == B);
        var w = c.fileapi && c.formdata;
        d("fileAPI :" + w);
        var r = (p || x) && !w;
        var v;
        if (j.iframe !== false && (j.iframe || r)) {
            if (j.closeKeepAlive) {
                f.get(j.closeKeepAlive, function () {
                    v = G(F)
                })
            } else {
                v = G(F)
            }
        } else {
            if ((p || x) && w) {
                v = t(F)
            } else {
                v = f.ajax(j)
            }
        }
        o.removeData("jqxhr").data("jqxhr", v);
        for (var A = 0; A < s.length; A++) {
            s[A] = null
        }
        this.trigger("form-submit-notify", [this, j]);
        return this;

        function g(K) {
            var L = f.param(K, j.traditional).split("&");
            var q = L.length;
            var k = [];
            var J, I;
            for (J = 0; J < q; J++) {
                L[J] = L[J].replace(/\+/g, " ");
                I = L[J].split("=");
                k.push([decodeURIComponent(I[0]), decodeURIComponent(I[1])])
            }
            return k
        }

        function t(q) {
            var k = new FormData();
            for (var I = 0; I < q.length; I++) {
                k.append(q[I].name, q[I].value)
            }
            if (j.extraData) {
                var L = g(j.extraData);
                for (I = 0; I < L.length; I++) {
                    if (L[I]) {
                        k.append(L[I][0], L[I][1])
                    }
                }
            }
            j.data = null;
            var K = f.extend(true, {}, f.ajaxSettings, j, {
                contentType: false,
                processData: false,
                cache: false,
                type: i || "POST"
            });
            if (j.uploadProgress) {
                K.xhr = function () {
                    var M = f.ajaxSettings.xhr();
                    if (M.upload) {
                        M.upload.addEventListener("progress", function (Q) {
                            var P = 0;
                            var N = Q.loaded || Q.position;
                            var O = Q.total;
                            if (Q.lengthComputable) {
                                P = Math.ceil(N / O * 100)
                            }
                            j.uploadProgress(Q, N, O, P)
                        }, false)
                    }
                    return M
                }
            }
            K.data = null;
            var J = K.beforeSend;
            K.beforeSend = function (N, M) {
                if (j.formData) {
                    M.data = j.formData
                } else {
                    M.data = k
                } if (J) {
                    J.call(this, N, M)
                }
            };
            return f.ajax(K)
        }

        function G(af) {
            var L = o[0],
                K, ab, V, ad, Y, N, Q, O, P, Z, ac, T;
            var ai = f.Deferred();
            ai.abort = function (aj) {
                O.abort(aj)
            };
            if (af) {
                for (ab = 0; ab < s.length; ab++) {
                    K = f(s[ab]);
                    if (e) {
                        K.prop("disabled", false)
                    } else {
                        K.removeAttr("disabled")
                    }
                }
            }
            V = f.extend(true, {}, f.ajaxSettings, j);
            V.context = V.context || V;
            Y = "jqFormIO" + (new Date().getTime());
            if (V.iframeTarget) {
                N = f(V.iframeTarget);
                Z = N.attr2("name");
                if (!Z) {
                    N.attr2("name", Y)
                } else {
                    Y = Z
                }
            } else {
                N = f('<iframe name="' + Y + '" src="' + V.iframeSrc + '" />');
                N.css({
                    position: "absolute",
                    top: "-1000px",
                    left: "-1000px"
                })
            }
            Q = N[0];
            O = {
                aborted: 0,
                responseText: null,
                responseXML: null,
                status: 0,
                statusText: "n/a",
                getAllResponseHeaders: function () {},
                getResponseHeader: function () {},
                setRequestHeader: function () {},
                abort: function (aj) {
                    var ak = (aj === "timeout" ? "timeout" : "aborted");
                    d("aborting upload... " + ak);
                    this.aborted = 1;
                    try {
                        if (Q.contentWindow.document.execCommand) {
                            Q.contentWindow.document.execCommand("Stop")
                        }
                    } catch (al) {}
                    N.attr("src", V.iframeSrc);
                    O.error = ak;
                    if (V.error) {
                        V.error.call(V.context, O, ak, aj)
                    }
                    if (ad) {
                        f.event.trigger("ajaxError", [O, V, ak])
                    }
                    if (V.complete) {
                        V.complete.call(V.context, O, ak)
                    }
                }
            };
            ad = V.global;
            if (ad && 0 === f.active++) {
                f.event.trigger("ajaxStart")
            }
            if (ad) {
                f.event.trigger("ajaxSend", [O, V])
            }
            if (V.beforeSend && V.beforeSend.call(V.context, O, V) === false) {
                if (V.global) {
                    f.active--
                }
                ai.reject();
                return ai
            }
            if (O.aborted) {
                ai.reject();
                return ai
            }
            P = L.clk;
            if (P) {
                Z = P.name;
                if (Z && !P.disabled) {
                    V.extraData = V.extraData || {};
                    V.extraData[Z] = P.value;
                    if (P.type == "image") {
                        V.extraData[Z + ".x"] = L.clk_x;
                        V.extraData[Z + ".y"] = L.clk_y
                    }
                }
            }
            var U = 1;
            var R = 2;

            function S(al) {
                var ak = null;
                try {
                    if (al.contentWindow) {
                        ak = al.contentWindow.document
                    }
                } catch (aj) {
                    d("cannot get iframe.contentWindow document: " + aj)
                }
                if (ak) {
                    return ak
                }
                try {
                    ak = al.contentDocument ? al.contentDocument : al.document
                } catch (aj) {
                    d("cannot get iframe.contentDocument: " + aj);
                    ak = al.document
                }
                return ak
            }
            var J = f("meta[name=csrf-token]").attr("content");
            var I = f("meta[name=csrf-param]").attr("content");
            if (I && J) {
                V.extraData = V.extraData || {};
                V.extraData[I] = J
            }

            function aa() {
                var ar = o.attr2("target"),
                    an = o.attr2("action"),
                    al = "multipart/form-data",
                    ao = o.attr("enctype") || o.attr("encoding") || al;
                L.setAttribute("target", Y);
                if (!i || /post/i.test(i)) {
                    L.setAttribute("method", "POST")
                }
                if (an != V.url) {
                    L.setAttribute("action", V.url)
                }
                if (!V.skipEncodingOverride && (!i || /post/i.test(i))) {
                    o.attr({
                        encoding: "multipart/form-data",
                        enctype: "multipart/form-data"
                    })
                }
                if (V.timeout) {
                    T = setTimeout(function () {
                        ac = true;
                        X(U)
                    }, V.timeout)
                }

                function ap() {
                    try {
                        var at = S(Q).readyState;
                        d("state = " + at);
                        if (at && at.toLowerCase() == "uninitialized") {
                            setTimeout(ap, 50)
                        }
                    } catch (au) {
                        d("Server abort: ", au, " (", au.name, ")");
                        X(R);
                        if (T) {
                            clearTimeout(T)
                        }
                        T = undefined
                    }
                }
                var aq = [];
                try {
                    if (V.extraData) {
                        for (var ak in V.extraData) {
                            if (V.extraData.hasOwnProperty(ak)) {
                                if (f.isPlainObject(V.extraData[ak]) && V.extraData[ak].hasOwnProperty("name") && V.extraData[ak].hasOwnProperty("value")) {
                                    aq.push(f('<input type="hidden" name="' + V.extraData[ak].name + '">').val(V.extraData[ak].value).appendTo(L)[0])
                                } else {
                                    aq.push(f('<input type="hidden" name="' + ak + '">').val(V.extraData[ak]).appendTo(L)[0])
                                }
                            }
                        }
                    }
                    if (!V.iframeTarget) {
                        N.appendTo("body")
                    }
                    if (Q.attachEvent) {
                        Q.attachEvent("onload", X)
                    } else {
                        Q.addEventListener("load", X, false)
                    }
                    setTimeout(ap, 15);
                    try {
                        L.submit()
                    } catch (am) {
                        var aj = document.createElement("form").submit;
                        aj.apply(L)
                    }
                } finally {
                    L.setAttribute("action", an);
                    L.setAttribute("enctype", ao);
                    if (ar) {
                        L.setAttribute("target", ar)
                    } else {
                        o.removeAttr("target")
                    }
                    f(aq).remove()
                }
            }
            if (V.forceSync) {
                aa()
            } else {
                setTimeout(aa, 10)
            }
            var ag, ah, ae = 50,
                M;

            function X(ap) {
                if (O.aborted || M) {
                    return
                }
                ah = S(Q);
                if (!ah) {
                    d("cannot access response document");
                    ap = R
                }
                if (ap === U && O) {
                    O.abort("timeout");
                    ai.reject(O, "timeout");
                    return
                } else {
                    if (ap == R && O) {
                        O.abort("server abort");
                        ai.reject(O, "error", "server abort");
                        return
                    }
                } if (!ah || ah.location.href == V.iframeSrc) {
                    if (!ac) {
                        return
                    }
                }
                if (Q.detachEvent) {
                    Q.detachEvent("onload", X)
                } else {
                    Q.removeEventListener("load", X, false)
                }
                var an = "success",
                    ar;
                try {
                    if (ac) {
                        throw "timeout"
                    }
                    var am = V.dataType == "xml" || ah.XMLDocument || f.isXMLDoc(ah);
                    d("isXml=" + am);
                    if (!am && window.opera && (ah.body === null || !ah.body.innerHTML)) {
                        if (--ae) {
                            d("requeing onLoad callback, DOM not available");
                            setTimeout(X, 250);
                            return
                        }
                    }
                    var at = ah.body ? ah.body : ah.documentElement;
                    O.responseText = at ? at.innerHTML : null;
                    O.responseXML = ah.XMLDocument ? ah.XMLDocument : ah;
                    if (am) {
                        V.dataType = "xml"
                    }
                    O.getResponseHeader = function (aw) {
                        var av = {
                            "content-type": V.dataType
                        };
                        return av[aw.toLowerCase()]
                    };
                    if (at) {
                        O.status = Number(at.getAttribute("status")) || O.status;
                        O.statusText = at.getAttribute("statusText") || O.statusText
                    }
                    var aj = (V.dataType || "").toLowerCase();
                    var aq = /(json|script|text)/.test(aj);
                    if (aq || V.textarea) {
                        var ao = ah.getElementsByTagName("textarea")[0];
                        if (ao) {
                            O.responseText = ao.value;
                            O.status = Number(ao.getAttribute("status")) || O.status;
                            O.statusText = ao.getAttribute("statusText") || O.statusText
                        } else {
                            if (aq) {
                                var ak = ah.getElementsByTagName("pre")[0];
                                var au = ah.getElementsByTagName("body")[0];
                                if (ak) {
                                    O.responseText = ak.textContent ? ak.textContent : ak.innerText
                                } else {
                                    if (au) {
                                        O.responseText = au.textContent ? au.textContent : au.innerText
                                    }
                                }
                            }
                        }
                    } else {
                        if (aj == "xml" && !O.responseXML && O.responseText) {
                            O.responseXML = W(O.responseText)
                        }
                    }
                    try {
                        ag = k(O, aj, V)
                    } catch (al) {
                        an = "parsererror";
                        O.error = ar = (al || an)
                    }
                } catch (al) {
                    d("error caught: ", al);
                    an = "error";
                    O.error = ar = (al || an)
                }
                if (O.aborted) {
                    d("upload aborted");
                    an = null
                }
                if (O.status) {
                    an = (O.status >= 200 && O.status < 300 || O.status === 304) ? "success" : "error"
                }
                if (an === "success") {
                    if (V.success) {
                        V.success.call(V.context, ag, "success", O)
                    }
                    ai.resolve(O.responseText, "success", O);
                    if (ad) {
                        f.event.trigger("ajaxSuccess", [O, V])
                    }
                } else {
                    if (an) {
                        if (ar === undefined) {
                            ar = O.statusText
                        }
                        if (V.error) {
                            V.error.call(V.context, O, an, ar)
                        }
                        ai.reject(O, "error", ar);
                        if (ad) {
                            f.event.trigger("ajaxError", [O, V, ar])
                        }
                    }
                } if (ad) {
                    f.event.trigger("ajaxComplete", [O, V])
                }
                if (ad && !--f.active) {
                    f.event.trigger("ajaxStop")
                }
                if (V.complete) {
                    V.complete.call(V.context, O, an)
                }
                M = true;
                if (V.timeout) {
                    clearTimeout(T)
                }
                setTimeout(function () {
                    if (!V.iframeTarget) {
                        N.remove()
                    } else {
                        N.attr("src", V.iframeSrc)
                    }
                    O.responseXML = null
                }, 100)
            }
            var W = f.parseXML || function (aj, ak) {
                if (window.ActiveXObject) {
                    ak = new ActiveXObject("Microsoft.XMLDOM");
                    ak.async = "false";
                    ak.loadXML(aj)
                } else {
                    ak = (new DOMParser()).parseFromString(aj, "text/xml")
                }
                return (ak && ak.documentElement && ak.documentElement.nodeName != "parsererror") ? ak : null
            };
            var q = f.parseJSON || function (aj) {
                return window["eval"]("(" + aj + ")")
            };
            var k = function (ao, am, al) {
                var ak = ao.getResponseHeader("content-type") || "",
                    aj = am === "xml" || !am && ak.indexOf("xml") >= 0,
                    an = aj ? ao.responseXML : ao.responseText;
                if (aj && an.documentElement.nodeName === "parsererror") {
                    if (f.error) {
                        f.error("parsererror")
                    }
                }
                if (al && al.dataFilter) {
                    an = al.dataFilter(an, am)
                }
                if (typeof an === "string") {
                    if (am === "json" || !am && ak.indexOf("json") >= 0) {
                        an = q(an)
                    } else {
                        if (am === "script" || !am && ak.indexOf("javascript") >= 0) {
                            f.globalEval(an)
                        }
                    }
                }
                return an
            };
            return ai
        }
    };
    f.fn.ajaxForm = function (g) {
        g = g || {};
        g.delegation = g.delegation && f.isFunction(f.fn.on);
        if (!g.delegation && this.length === 0) {
            var h = {
                s: this.selector,
                c: this.context
            };
            if (!f.isReady && h.s) {
                d("DOM not ready, queuing ajaxForm");
                f(function () {
                    f(h.s, h.c).ajaxForm(g)
                });
                return this
            }
            d("terminating; zero elements found by selector" + (f.isReady ? "" : " (DOM not ready)"));
            return this
        }
        if (g.delegation) {
            f(document).off("submit.form-plugin", this.selector, b).off("click.form-plugin", this.selector, a).on("submit.form-plugin", this.selector, g, b).on("click.form-plugin", this.selector, g, a);
            return this
        }
        return this.ajaxFormUnbind().bind("submit.form-plugin", g, b).bind("click.form-plugin", g, a)
    };

    function b(h) {
        var g = h.data;
        if (!h.isDefaultPrevented()) {
            h.preventDefault();
            f(h.target).ajaxSubmit(g)
        }
    }

    function a(k) {
        var j = k.target;
        var h = f(j);
        if (!(h.is("[type=submit],[type=image]"))) {
            var g = h.closest("[type=submit]");
            if (g.length === 0) {
                return
            }
            j = g[0]
        }
        var i = this;
        i.clk = j;
        if (j.type == "image") {
            if (k.offsetX !== undefined) {
                i.clk_x = k.offsetX;
                i.clk_y = k.offsetY
            } else {
                if (typeof f.fn.offset == "function") {
                    var l = h.offset();
                    i.clk_x = k.pageX - l.left;
                    i.clk_y = k.pageY - l.top
                } else {
                    i.clk_x = k.pageX - j.offsetLeft;
                    i.clk_y = k.pageY - j.offsetTop
                }
            }
        }
        setTimeout(function () {
            i.clk = i.clk_x = i.clk_y = null
        }, 100)
    }
    f.fn.ajaxFormUnbind = function () {
        return this.unbind("submit.form-plugin click.form-plugin")
    };
    f.fn.formToArray = function (x, g) {
        var w = [];
        if (this.length === 0) {
            return w
        }
        var l = this[0];
        var z = this.attr("id");
        var q = x ? l.getElementsByTagName("*") : l.elements;
        var A;
        if (q && !/MSIE [678]/.test(navigator.userAgent)) {
            q = f(q).get()
        }
        if (z) {
            A = f(":input[form=" + z + "]").get();
            if (A.length) {
                q = (q || []).concat(A)
            }
        }
        if (!q || !q.length) {
            return w
        }
        var r, p, o, y, m, t, k;
        for (r = 0, t = q.length; r < t; r++) {
            m = q[r];
            o = m.name;
            if (!o || m.disabled) {
                continue
            }
            if (x && l.clk && m.type == "image") {
                if (l.clk == m) {
                    w.push({
                        name: o,
                        value: f(m).val(),
                        type: m.type
                    });
                    w.push({
                        name: o + ".x",
                        value: l.clk_x
                    }, {
                        name: o + ".y",
                        value: l.clk_y
                    })
                }
                continue
            }
            y = f.fieldValue(m, true);
            if (y && y.constructor == Array) {
                if (g) {
                    g.push(m)
                }
                for (p = 0, k = y.length; p < k; p++) {
                    w.push({
                        name: o,
                        value: y[p]
                    })
                }
            } else {
                if (c.fileapi && m.type == "file") {
                    if (g) {
                        g.push(m)
                    }
                    var h = m.files;
                    if (h.length) {
                        for (p = 0; p < h.length; p++) {
                            w.push({
                                name: o,
                                value: h[p],
                                type: m.type
                            })
                        }
                    } else {
                        w.push({
                            name: o,
                            value: "",
                            type: m.type
                        })
                    }
                } else {
                    if (y !== null && typeof y != "undefined") {
                        if (g) {
                            g.push(m)
                        }
                        w.push({
                            name: o,
                            value: y,
                            type: m.type,
                            required: m.required
                        })
                    }
                }
            }
        }
        if (!x && l.clk) {
            var s = f(l.clk),
                u = s[0];
            o = u.name;
            if (o && !u.disabled && u.type == "image") {
                w.push({
                    name: o,
                    value: s.val()
                });
                w.push({
                    name: o + ".x",
                    value: l.clk_x
                }, {
                    name: o + ".y",
                    value: l.clk_y
                })
            }
        }
        return w
    };
    f.fn.formSerialize = function (g) {
        return f.param(this.formToArray(g))
    };
    f.fn.fieldSerialize = function (h) {
        var g = [];
        this.each(function () {
            var m = this.name;
            if (!m) {
                return
            }
            var k = f.fieldValue(this, h);
            if (k && k.constructor == Array) {
                for (var l = 0, j = k.length; l < j; l++) {
                    g.push({
                        name: m,
                        value: k[l]
                    })
                }
            } else {
                if (k !== null && typeof k != "undefined") {
                    g.push({
                        name: this.name,
                        value: k
                    })
                }
            }
        });
        return f.param(g)
    };
    f.fn.fieldValue = function (m) {
        for (var l = [], j = 0, g = this.length; j < g; j++) {
            var k = this[j];
            var h = f.fieldValue(k, m);
            if (h === null || typeof h == "undefined" || (h.constructor == Array && !h.length)) {
                continue
            }
            if (h.constructor == Array) {
                f.merge(l, h)
            } else {
                l.push(h)
            }
        }
        return l
    };
    f.fieldValue = function (g, o) {
        var j = g.name,
            u = g.type,
            w = g.tagName.toLowerCase();
        if (o === undefined) {
            o = true
        }
        if (o && (!j || g.disabled || u == "reset" || u == "button" || (u == "checkbox" || u == "radio") && !g.checked || (u == "submit" || u == "image") && g.form && g.form.clk != g || w == "select" && g.selectedIndex == -1)) {
            return null
        }
        if (w == "select") {
            var p = g.selectedIndex;
            if (p < 0) {
                return null
            }
            var r = [],
                h = g.options;
            var l = (u == "select-one");
            var q = (l ? p + 1 : h.length);
            for (var k = (l ? p : 0); k < q; k++) {
                var m = h[k];
                if (m.selected) {
                    var s = m.value;
                    if (!s) {
                        s = (m.attributes && m.attributes.value && !(m.attributes.value.specified)) ? m.text : m.value
                    }
                    if (l) {
                        return s
                    }
                    r.push(s)
                }
            }
            return r
        }
        return f(g).val()
    };
    f.fn.clearForm = function (g) {
        return this.each(function () {
            f("input,select,textarea", this).clearFields(g)
        })
    };
    f.fn.clearFields = f.fn.clearInputs = function (g) {
        var h = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;
        return this.each(function () {
            var j = this.type,
                i = this.tagName.toLowerCase();
            if (h.test(j) || i == "textarea") {
                this.value = ""
            } else {
                if (j == "checkbox" || j == "radio") {
                    this.checked = false
                } else {
                    if (i == "select") {
                        this.selectedIndex = -1
                    } else {
                        if (j == "file") {
                            if (/MSIE/.test(navigator.userAgent)) {
                                f(this).replaceWith(f(this).clone(true))
                            } else {
                                f(this).val("")
                            }
                        } else {
                            if (g) {
                                if ((g === true && /hidden/.test(j)) || (typeof g == "string" && f(this).is(g))) {
                                    this.value = ""
                                }
                            }
                        }
                    }
                }
            }
        })
    };
    f.fn.resetForm = function () {
        return this.each(function () {
            if (typeof this.reset == "function" || (typeof this.reset == "object" && !this.reset.nodeType)) {
                this.reset()
            }
        })
    };
    f.fn.enable = function (g) {
        if (g === undefined) {
            g = true
        }
        return this.each(function () {
            this.disabled = !g
        })
    };
    f.fn.selected = function (g) {
        if (g === undefined) {
            g = true
        }
        return this.each(function () {
            var h = this.type;
            if (h == "checkbox" || h == "radio") {
                this.checked = g
            } else {
                if (this.tagName.toLowerCase() == "option") {
                    var i = f(this).parent("select");
                    if (g && i[0] && i[0].type == "select-one") {
                        i.find("option").selected(false)
                    }
                    this.selected = g
                }
            }
        })
    };
    f.fn.ajaxSubmit.debug = false;

    function d() {
        if (!f.fn.ajaxSubmit.debug) {
            return
        }
        var g = "[jquery.form] " + Array.prototype.join.call(arguments, "");
        if (window.console && window.console.log) {
            window.console.log(g)
        } else {
            if (window.opera && window.opera.postError) {
                window.opera.postError(g)
            }
        }
    }
}));

jQuery(document).ready(function(){
	
	/*Add Class Js to html*/
	jQuery('html').addClass('js');	
	
	show_tab();
	
	show_toggle();
	
	portfolio_effect();
	
	quickreadajax();
	
	toggle_menu();
	
	show_socialicon();
	
	show_lightbox();
	
	show_carousel();
	
	appear_effect();
	
	form_styling();
	
	slider_init();
	
	fullwidthwrap();
	
	change_uberOrientation();
});

jQuery(window).load(function(){
	header_effect();
	show_menu();
	isotopeinit();
	
	timeline_effect();
});

jQuery(window).resize(function(){
	isotopeinit();
	fullwidthwrap();
	change_uberOrientation();
});

function header_effect(){
	"use strict";
	/*=================================== TOPSEARCH ==============================*/
	var outerheader = jQuery('#outerheaderauthor').wrap('<div id="headerauthorwrapper"></div>');
	var outerheaderw = jQuery('#headerauthorwrapper');
	var wpadminbar = jQuery('#wpadminbar');
	
	var adminbarinnerh = wpadminbar.innerHeight();
	var outerheaderinnerh = outerheader.innerHeight();
	var outerheadertop = outerheader.css("top");
	var windowheight = jQuery(window).height();
	var outerheaderoffset = outerheader.offset().top;
	
	if(jQuery('body').hasClass('nvrlayout4')!=true){
		outerheaderw.css('height',outerheaderinnerh);
	}
	
	jQuery(window).scroll(function(evt){
		var scrolltop = jQuery(document).scrollTop();

		if(scrolltop>(outerheaderoffset)){
			outerheader.addClass("sticky");
		}else{
			outerheader.removeClass("sticky");
		}
	});
}

function show_menu(){
	"use strict";
	/*=================================== MENU ===================================*/
    jQuery("ul.sf-menu").supersubs({ 
    minWidth		: 12,		/* requires em unit. */
    maxWidth		: 15,		/* requires em unit. */
    extraWidth		: 0	/* extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values */
                           /* due to slight rounding differences and font-family */
    }).superfish();  /* 
						call supersubs first, then superfish, so that subs are 
                        not display:none when measuring. Call before initialising 
                        containing tabs for same reason. 
					 */
}

function change_uberOrientation(){
	"use strict";
	var winwidth = jQuery(window).width();
	if(jQuery('body').hasClass('nvrlayout4')){
		if(winwidth>1023){
			jQuery('#megaMenu').addClass('megaMenuVertical').removeClass('megaMenuHorizontal');
		}else{
			jQuery('#megaMenu').addClass('megaMenuHorizontal').removeClass('megaMenuVertical');
		}
	}
}

function appear_effect(){
	"use strict";
	//Elements Fading
	jQuery('.element_from_top').each(function () {
		jQuery(this).appear(function() {
		  jQuery(this).delay(150).animate({opacity:1,top:"0px"},1000);
		});	
	});
	
	jQuery('.element_from_bottom').each(function () {
		jQuery(this).appear(function() {
		  jQuery(this).delay(150).animate({opacity:1,bottom:"0px"},1000);
		});	
	});
	
	
	jQuery('.element_from_left').each(function () {
		jQuery(this).appear(function() {
		  jQuery(this).delay(150).animate({opacity:1,left:"0px"},1000);
		});	
	});
	
	
	jQuery('.element_from_right').each(function () {
		jQuery(this).appear(function() {
		  jQuery(this).delay(150).animate({opacity:1,right:"0px"},1000);
		});	
	});
		
	jQuery('.element_fade_in').each(function () {
		jQuery(this).appear(function() {
		  jQuery(this).delay(150).animate({opacity:1,right:"0px"},1000);
		});	
	});
}

function toggle_menu(){
	"use strict";
	jQuery('a.nav-toggle').click(function(evt){
		var outerheader = jQuery('#outerheader');
		var outerheaderinnerh = outerheader.innerHeight();
		var topnavpos = outerheaderinnerh ;
		
		jQuery('.topnav').css('top', topnavpos);
		jQuery('.topnav').slideToggle('slow',function(){});
		
		jQuery('.topnav li a').click(function(){
			jQuery('.topnav').slideUp('slow');
		});
	});
}

/* !Fullwidth wrap for shortcodes & templates */
function fullwidthwrap(){
	"use strict";
	if( jQuery(".nvr-fullwidthwrap").length && jQuery(".nosidebar").length ){
		jQuery(".nvr-fullwidthwrap").each(function(){
			var $_this = jQuery(this),
				offset_wrap = $_this.position().left;

				var $offset_fs;
				var $scrollBar = 0;
			 	var containerwidth = jQuery('#outermain .container').width();
				var outerwidth = (jQuery('#outercontainer').width() - (jQuery('#outercontainer').width()%2));

				var paddingcol = parseInt(jQuery('.columns').css('padding-left'));

				if( jQuery('body').hasClass('boxed') ){
					$offset_fs = ((parseInt(outerwidth) - parseInt(containerwidth)) / 2);
				} else {
						var $windowWidth = (jQuery(window).width() <= parseInt(containerwidth)) ? parseInt(containerwidth) : jQuery(window).width();
						$offset_fs = Math.ceil( ((outerwidth + $scrollBar - parseInt(containerwidth)) / 2) );
				};
				$_this.css({
					width: outerwidth,
					"margin-left": -$offset_fs
				});
		});
	};
};

function show_tab(){
	"use strict";
	/*jQuery tab */
	var pathurl = window.location.href.split("#tab");
	var deftab = "";
	
	jQuery(".tab-content").hide(); /* Hide all content */
	if(pathurl.length>1){ 
		deftab = "#"+pathurl[1];
		var pdeftab = jQuery("ul.tabs li a[href="+deftab+"]").parent().addClass("active").show();
		var tabcondeftab = ".tabcontainer "+deftab;
		jQuery(tabcondeftab).show();
	}else{
		jQuery("ul.tabs li:first").addClass("active").show(); /* Activate first tab */
		jQuery(".tab-content:first").show(); /* Show first tab content */
	}
	/* On Click Event */
	jQuery("ul.tabs li").click(function() {
		jQuery("ul.tabs li").removeClass("active"); /* Remove any "active" class */
		jQuery(this).addClass("active"); /* Add "active" class to selected tab */
		jQuery(".tab-content").hide(); /* Hide all tab content */
		var activeTab = jQuery(this).find("a").attr("href"); /* Find the rel attribute value to identify the active tab + content */
		jQuery(activeTab).fadeIn(200); /* Fade in the active content */
		return false;
	});
}

function show_toggle(){
	"use strict";
	/*jQuery toggle*/
	jQuery(".toggle_container").hide();
	var isiPhone = /iphone/i.test(navigator.userAgent.toLowerCase());
	if (isiPhone){
		jQuery("h2.trigger").click(function(){
			if( jQuery(this).hasClass("active")){
				jQuery(this).removeClass("active");
				jQuery(this).next().css('display','none');
			}else{
				jQuery(this).addClass("active");
				jQuery(this).next().css('display','block');
			}
		});
	}else{
		jQuery("h2.trigger").click(function(){
			jQuery(this).toggleClass("active").next().slideToggle("slow");
		});
	}
}

function portfolio_effect(){
	"use strict";
	/*=================================== FADE EFFECT ===================================*/
	jQuery('.nvr-pf-container li .nvr-pf-img, .flexslider-carousel li .nvr-pf-img, div.frameimg').mouseenter(function(){
		jQuery(this).find('div.rollover').stop().animate({"opacity":0.75}, 500, 'easeOutCubic');
		jQuery(this).find('a.image').stop().animate({"left":"50%","opacity":0.90}, 500, 'easeOutCubic');
		jQuery(this).find('a.zoom').stop().animate({"left":"50%","opacity":0.90}, 500, 'easeOutCubic');
	});
	jQuery('.nvr-pf-container li .nvr-pf-img, .flexslider-carousel li .nvr-pf-img, div.frameimg').mouseleave(function(){
		jQuery(this).find('div.rollover').stop().animate({"opacity":0}, 500, 'easeOutCubic');
		jQuery(this).find('a.image').stop().animate({"left":"-10%","opacity":0}, 500, 'easeOutCubic');
		jQuery(this).find('a.zoom').stop().animate({"left":"110%","opacity":0}, 500, 'easeOutCubic');
	});
}

function quickreadajax(){
	
	jQuery('a.quickread').click(function(evt){
		
		evt.preventDefault();
		
		var pfitem = jQuery(this);
		var pfurl = jQuery(this).attr('href');
		var blogcontainer = jQuery(this).parents('#nvr-blogcontainer');
		var ajaxbutton = blogcontainer.find('a.btnajax');
		var thebottom = blogcontainer.find('.blogbottom');
		var pajaxholder = blogcontainer.find('div.quickread-ajax-holder');
		var pajaxdata = blogcontainer.find('div.quickread-ajax-data');
		
		var cactive = false;
		var loadedimages = 0;
		var loadedpercent = 0;
		var outerheader = jQuery('#outerheader');
		var wpadminbar = jQuery('#wpadminbar');
		
		var adminbarinnerh = wpadminbar.innerHeight();
		var outerheaderinnerh = outerheader.innerHeight();
		var topscrolledge = adminbarinnerh+outerheaderinnerh;
		
		pajaxholder.removeClass('preloader');
		
		if(pfitem.hasClass('active')){
			
		}else{
		
			pfitem.addClass('active');

			pajaxholder.appendTo('#subbody');
			ajaxbutton.click(function(){
					
				pajaxholder.delay(400).fadeOut(600, function(){
					pajaxdata.empty();
					pajaxholder.perfectScrollbar('destroy');
					pajaxholder.appendTo(blogcontainer);
				});
				
				pfitem.removeClass('active') ;
			  
				return false;
			});
			
			pajaxholder.fadeIn(600, function(){ 
				pajaxdata.css('visibility', 'visible');
				pajaxdata.fadeOut(100);
				pajaxholder.addClass('preloader');
				
				var jqxhr = jQuery.ajax({
					url : pfurl,
					cache : false,
					dataType : 'html',
					async : true,
					beforeSend : function(){
						pajaxdata.empty();
					},
					xhr: function(){
						var xhr = new window.XMLHttpRequest();
						/*Upload progress*/
						xhr.upload.addEventListener("progress", function(evt){
							if (evt.lengthComputable) {
								var percentComplete = evt.loaded / evt.total;
								/*Do something with upload progress*/
								console.log(percentComplete);
							}
						}, false);
						/*Download progress*/
						xhr.addEventListener("progress", function(evt){
							if (evt.lengthComputable) {
								var percentComplete = Math.round((evt.loaded/evt.total)*100);
								/*Do something with download progress*/
								console.log(percentComplete);
							}
						}, false);
						return xhr;
					}
				});
				
				jqxhr.done(function(data, textStatus){
					
					var content = data;
					
					pajaxdata.append(content);
						
					pajaxdata.imagesLoaded()
					.always( function( instance ) {
						console.log('loading images');
					})
					.done( function( instance ) {
						pajaxholder.perfectScrollbar({includePadding : true});
						pajaxdata.delay(1000).fadeIn(900,function(){ 
							pajaxholder.removeClass('preloader'); 
							pajaxholder.scrollTop(0);
							pajaxholder.perfectScrollbar('update');
							slider_init();
						});
	
						jQuery('.element_fade_in').each(function () {
							jQuery(this).appear(function() {
								jQuery(this).delay(100).animate({opacity:1,right:"0px"},1000);
							});
						});
						
					})
					.fail( function() {
						console.log('all images loaded, at least one is broken');
					})
					.progress( function( instance, image ) {
						var totalimage = instance.images.length;
						var result = image.isLoaded ? 'loaded' : 'broken';
						if(result=='loaded'){
							loadedimages++;
						}
						loadedpercent = Math.round((loadedimages/totalimage)*100);
						console.log( 'image is ' + result + ' for ' + image.img.src );
					});
			
				});
				
				jqxhr.fail(function(error, textStatus){
					alert( "Request failed: " + textStatus );
				});
			
			});
		
		}
		
		return false;
	
	});
}

function show_socialicon(){
	"use strict";
	/*=================================== SOCIAL ICON ===================================*/
	var socialicons = jQuery('ul.sn li a');
	socialicons.hover(
		function() {
			var iconimg = jQuery(this).children();
			iconimg.stop(true,true);
			iconimg.fadeOut(500);
		},
		function() {
			var iconimg = jQuery(this).children();
			iconimg.stop(true,true);
			iconimg.fadeIn(500);
		}
	);
	
	if (window.devicePixelRatio > 1) {

		socialicons.each(function(i) {
			var lowres = jQuery(this).css('background-image');
			var highres = lowres.replace(".png", "@2x.png");
			jQuery(this).css('background-image', highres);
		});
	}
}

function show_lightbox(){
	"use strict";
	/*=================================== PRETTYPHOTO ===================================*/
	jQuery('a[data-rel]').each(function() {jQuery(this).attr('rel', jQuery(this).data('rel'));});
	jQuery("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',gallery_markup:'',slideshow:2000});
}

function show_carousel(){
	"use strict";
	var ctype = {
		"pcarousel" : {
			"index" : '.pcarousel .flexslider-carousel, .postcarousel .flexslider-carousel',
			"minItems" : 2,
			"maxItems" : 4,
			"itemWidth" : 197
		},
		"bcarousel" : {
			"index" : '.brand .flexslider-carousel',
			"minItems" : 2,
			"maxItems" : 5,
			"itemWidth" : 197
		}
	}
	
	for(var key in ctype){
		var carousel = ctype[key];
		jQuery(carousel.index).flexslider({
			animation: "slide",
			animationLoop: true,
			directionNav: true,
			controlNav: false,
			itemWidth: carousel.itemWidth,
			itemMargin: 0,
			minItems: carousel.minItems,
			maxItems: carousel.maxItems
		 });
	}
}

function slider_init(){
	"use strict";
	var slidereffect 			= interfeis_var.slidereffect;
    var slider_interval 		= interfeis_var.slider_interval;
    var slider_disable_nav 		= interfeis_var.slider_disable_nav;
    var slider_disable_prevnext	= interfeis_var.slider_disable_prevnext;
    
    if(slider_disable_prevnext=="0"){
        var direction_nav = true;
    }else{
        var direction_nav = false;
    }
    
    if(slider_disable_nav=="0"){
        var control_nav = true;
    }else{
        var control_nav = false;
    }

    jQuery('.flexslider').flexslider({
        animation: slidereffect,
        slideshowSpeed: slider_interval,
        directionNav: direction_nav,
        controlNav: control_nav,
        smoothHeight: true,
		pauseOnHover: true,
		prevText : '',
		nextText : '',
		start : function(){
			jQuery('#slideritems').removeClass('preloader');
		}
    });
}

function isotopeinit(){
	"use strict";
	
	var pffilter = jQuery('#nvr-pf-filter');
    pffilter.isotope({
        itemSelector : '.element'
    });
	
	pffilter.infinitescroll({
		loading: {
			finishedMsg: 'ALL POSTS LOADED',
			msg: null,
			msgText: 'LOADING NEXT POSTS',
			img: interfeis_var.themeurl + 'http://2.bp.blogspot.com/-ffaUeyhmdPo/U7TUdjDBRGI/AAAAAAAABLQ/SCPkBMywPPc/s1600/pf-loader.gif'
		  },
			navSelector  : '#loadmore-paging',    // selector for the paged navigation 
			nextSelector : '#loadmore-paging .loadmorebutton a:first',  // selector for the NEXT link (to page 2)
			itemSelector : '.element',     // selector for all items you'll retrieve
			bufferPx: 40
		},
       	// call Isotope as a callback
		function ( newElements ) {

			var $newElems = jQuery( newElements ).css({ opacity: 0 });
			$newElems.imagesLoaded(function(){
				$newElems.animate({ opacity: 1 });
				pffilter.isotope( 'appended', $newElems, true );
				pffilter.isotope('reLayout');
				portfolio_effect();
				show_lightbox();
			});
		}
	);
	
	jQuery('#filters li').click(function(){
        jQuery('#filters li').removeClass('selected');
        jQuery(this).addClass('selected');
        var selector = jQuery(this).find('a').attr('data-option-value');
        pffilter.isotope({ filter: selector });
        return false;
    });
	
	var postisotope = jQuery('.postscontainer.mason').isotope({
		itemSelector : '.articlewrapper'
	});
	
	postisotope.infinitescroll({
		loading: {
			finishedMsg: 'Finished',
			msg: null,
			msgText: 'Loading',
			img: interfeis_var.themeurl + 'http://2.bp.blogspot.com/-ffaUeyhmdPo/U7TUdjDBRGI/AAAAAAAABLQ/SCPkBMywPPc/s1600/pf-loader.gif'

		  },
			navSelector  : '#loadmore-paging',    // selector for the paged navigation 
			nextSelector : '#loadmore-paging .loadmorebutton a:first',  // selector for the NEXT link (to page 2)
			itemSelector : '.articlewrapper',     // selector for all items you'll retrieve
			bufferPx: 40
		},
       	// call Isotope as a callback
		function ( newElements, opts ) {
			slider_init();
			quickreadajax();
			var $newElems = jQuery( newElements ).css({ opacity: 0 });
			$newElems.imagesLoaded(function(){
				$newElems.animate({ opacity: 1 });
				postisotope.isotope( 'appended', $newElems, true );
				postisotope.isotope('reLayout', function(){
					timeline_effect();
				});
				jQuery('#loadmore-paging').css('display','block');
			});
		}
	);
	
	jQuery(window).unbind('.infscr');
	
	jQuery('#loadmore-paging .loadmorebutton a:first').click(function(evt){
		pffilter.infinitescroll('retrieve');
		postisotope.infinitescroll('retrieve');
		return false;
	});	
	jQuery(document).ajaxError(function(e,xhr,opt){
		if(xhr.status==404){
			jQuery('#loadmore-paging a').remove(); 
			jQuery('#loadmore-paging').addClass('nomoreload');
			jQuery('#loadmore-paging .finished').css('display','block');
		}
	});
}

function form_styling(){
	"use strict";
	/* Select */
	var selects = jQuery('select#cmbpostdomain');
	selects.wrap('<div class="nvr_selector" />');
	var selector = jQuery('.nvr_selector');
	selector.prepend('<span />');
	selector.each(function(){
		var selval = jQuery(this).find('select option:selected').text();
		var sel = jQuery(this).children('select');
		var selclass = sel.attr('class');
		jQuery(this).children('span').text(selval);
		jQuery(this).addClass(selclass);
		sel.css('width','100%');
		sel.change(function(){
			var selvals = jQuery(this).children('option:selected').text();
			jQuery(this).parent().children('span').text(selvals);
		});
	});
}

function timeline_effect(){
	"use strict";
	
	var article = jQuery('.postscontainer.timeline .articlewrapper');
	article.each(function(idx){
		var thisarticle = jQuery(this);
		var posarticle = thisarticle.position();
		if(posarticle.left>20){
			thisarticle.addClass('posright');
		}else{
			thisarticle.addClass('posleft');
		}
	});
}
//]]>